﻿<Window x:Class="ContactTracing.CaseView.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:Controls="clr-namespace:ContactTracing.CaseView.Controls"
        xmlns:Tabs="clr-namespace:ContactTracing.CaseView.Controls.Tabs"
        xmlns:AnalysisControls="clr-namespace:ContactTracing.CaseView.Controls.Analysis"
        xmlns:local="clr-namespace:ContactTracing.CaseView"
        xmlns:diag="clr-namespace:ContactTracing.CaseView.Controls.Diagnostics"     
    xmlns:core="clr-namespace:ContactTracing.Core;assembly=ContactTracing.Core"          
        xmlns:wpf="clr-namespace:ContactTracing.Controls;assembly=ContactTracing.WPF"
        xmlns:converters="clr-namespace:ContactTracing.Core.Converters;assembly=ContactTracing.Core"
        xmlns:scm="clr-namespace:System.ComponentModel;assembly=WindowsBase"
        xmlns:p="clr-namespace:ContactTracing.CaseView.Properties"
        xmlns:vm="clr-namespace:ContactTracing.ViewModel;assembly=ContactTracing.ViewModel"
        xmlns:sys="clr-namespace:System;assembly=mscorlib"
        xmlns:Converts="clr-namespace:ContactTracing.CaseView.Converters"
        MinWidth="790"
        MinHeight="580"
        Icon="App.ico"
        SnapsToDevicePixels="True"
        Title="{Binding Source={x:Static p:Settings.Default}, Path=WindowTitle, Mode=OneWay}" 
        Background="{StaticResource WindowBackgroundBrush}"
        
        Left="{Binding Source={x:Static p:Settings.Default}, Path=WindowLeft, Mode=TwoWay}"
        Top="{Binding Source={x:Static p:Settings.Default}, Path=WindowTop, Mode=TwoWay}"
        
        Height="{Binding Source={x:Static p:Settings.Default}, Path=WindowHeight, Mode=TwoWay}" 
        Width="{Binding Source={x:Static p:Settings.Default}, Path=WindowWidth, Mode=TwoWay}" 
        WindowState="{Binding Source={x:Static p:Settings.Default}, Path=WindowState, Mode=TwoWay}"
        
        Loaded="Window_Loaded" SizeChanged="Window_SizeChanged" Closing="Window_Closing">
    <Window.IsEnabled>
        <MultiBinding Converter="{StaticResource MultiBooleanCaseWindowToEnabledConverter}" >
            <Binding Path="IsCheckingServerForUpdates" />
            <Binding Path="IsShowingCaseReportForm" />
        </MultiBinding>
    </Window.IsEnabled>

    <!-- TODO: Window needs a total and complete re-write -->
    <Window.InputBindings>
        <KeyBinding Key="F5" Command="{Binding RepopulateCollectionsCommand}" CommandParameter="{StaticResource True}" />
    </Window.InputBindings>
    <Window.DataContext>
        <local:EpiDataHelper x:Name="epiDataHelper" 
            InitialSetupRun="EpiDataHelper_InitialSetupRun" 
                             
            CaseDeleted="EpiDataHelper_CaseDeleted"
            DuplicateIdDetected="EpiDataHelper_DuplicateIdDetected"
            CaseDataPopulated="EpiDataHelper_CaseDataPopulated"
            IssueDataPopulated="EpiDataHelper_IssueDataPopulated"
                             FollowUpVisitUpdated="EpiDataHelper_FollowUpVisitUpdated"
                             RefreshRequired="EpiDataHelper_RefreshRequired"
                             CaseSwitchToLegacyEnter="EpiDataHelper_CaseSwitchToLegacyEnter"
                             SyncProblemsDetected="EpiDataHelper_SyncProblemsDetected"
            />
    </Window.DataContext>
    <Window.TaskbarItemInfo>
        <TaskbarItemInfo ProgressState="{Binding TaskbarProgressState}" ProgressValue="{Binding TaskbarProgressValue}" />
    </Window.TaskbarItemInfo>
    <Window.Resources>
        <converters:UppercaseConverter x:Key="UppercaseConverter" />
        <Converts:HCWConverter x:Key="HCWConverter"/>
        <Converts:BindingProxy x:Key="proxy" Data="{Binding}" />
        <Converts:DateConverter x:Key="DateConverter"/>
        <Converts:FinalOutcomeConverter x:Key="FinalOutcomeConverter" />
        <!--<CollectionViewSource x:Key="CaseViewSource" Source="{Binding CaseCollection}">
            <CollectionViewSource.SortDescriptions>
                <scm:SortDescription PropertyName="ID" />
            </CollectionViewSource.SortDescriptions>
        </CollectionViewSource>-->
        <local:EnumDescriptionConverter x:Key="EnumDescriptionConverter" />
        <BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>

        <SolidColorBrush x:Key="textMediumGray" Color="#FF727272"></SolidColorBrush>
        <SolidColorBrush x:Key="textDarkGray" Color="#FF383838"></SolidColorBrush>
        <SolidColorBrush x:Key="lineDefault" Color="Gray"></SolidColorBrush>
        <SolidColorBrush x:Key="buttonHomeHighlight" Color="#5EA8DE"></SolidColorBrush>
        <SolidColorBrush x:Key="buttonAnalysisHighlight" Color="#5EA8DE"></SolidColorBrush>
        <SolidColorBrush x:Key="buttonDataEntryHighlight" Color="#5EA8DE"></SolidColorBrush>
        <SolidColorBrush x:Key="buttonDataManagementHighlight" Color="#5EA8DE"></SolidColorBrush>
        <SolidColorBrush x:Key="buttonMapsHighlight" Color="#5EA8DE"></SolidColorBrush>
        <SolidColorBrush x:Key="buttonStatusHighlight" Color="#5EA8DE"></SolidColorBrush>
    </Window.Resources>
    <Grid VerticalAlignment="Stretch" x:Name="grdMain" Background="{StaticResource WindowBackgroundBrush}">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="1" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>

        <StackPanel Grid.Row="0" Background="{StaticResource NoiseBrush}">
            <StackPanel>
                <StackPanel.Background>
                    <SolidColorBrush Color="{StaticResource EditionThemeAccentColor}" Opacity="0.8" />
                </StackPanel.Background>
                <Grid Margin="6">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition />
                        <ColumnDefinition MinWidth="64" Width="Auto" />
                        <ColumnDefinition MinWidth="64" Width="Auto" />
                        <ColumnDefinition MinWidth="64" Width="Auto" />
                        <ColumnDefinition MinWidth="64" Width="Auto" />
                    </Grid.ColumnDefinitions>

                    <StackPanel Grid.Column="0">
                        <TextBlock Margin="24, 4, 0, 0" Style="{StaticResource Heading1}" FontWeight="Light" Foreground="White" x:Name="tblockHeading1" Text="{Binding OutbreakName, Mode=TwoWay}" />
                    </StackPanel>

                    <StackPanel Grid.Column="1" HorizontalAlignment="Center" Margin="4, 0, 0, 0">
                        <wpf:LightOnDarkCircleButton x:Name="btnDataTools" Text="Tools" PathData="F1 M 25.3333,42.75C 26.5189,42.75 27.6436,43.0106 28.6533,43.4777L 34.9459,37.185L 32.5825,34.8217L 30.3433,37.0609L 28.1042,34.8217L 29.0343,33.8915C 27.1425,33.1521 25.7233,31.6492 23.4735,29.3994C 18.836,24.7619 16.1846,19.8945 18.0395,18.0396C 19.8945,16.1846 23.9702,18.0444 28.6077,22.6819C 30.8575,24.9317 33.1521,27.1425 33.8915,29.0344L 34.8217,28.1042L 37.0608,30.3433L 34.8217,32.5825L 37.185,34.9459L 43.4777,28.6533C 43.0106,27.6436 42.75,26.5189 42.75,25.3333C 42.75,20.9611 46.2944,17.4167 50.6667,17.4167C 51.6877,17.4167 52.6636,17.61 53.5597,17.9619L 47.5,24.0216L 51.9783,28.5L 58.0381,22.4403C 58.39,23.3364 58.5833,24.3123 58.5833,25.3333C 58.5833,29.7056 55.0389,33.25 50.6667,33.25C 49.8136,33.25 48.9921,33.1151 48.2222,32.8654L 41.6634,39.4242L 50.8787,48.6395L 51.4384,48.0797L 56.8841,53.5253L 53.5253,56.8841L 48.0797,51.4384L 48.6395,50.8787L 39.4242,41.6634L 32.8654,48.2222C 33.1151,48.9921 33.25,49.8136 33.25,50.6667C 33.25,55.0389 29.7056,58.5833 25.3333,58.5833C 24.3123,58.5833 23.3364,58.39 22.4403,58.0381L 28.5,51.9783L 24.0217,47.5L 17.9619,53.5597C 17.61,52.6636 17.4167,51.6877 17.4167,50.6667C 17.4167,46.2944 20.9611,42.75 25.3333,42.75 Z "
                                                          Click="btnDataTools_Click">
                            <wpf:LightOnDarkCircleButton.ContextMenu>
                                <ContextMenu>
                                    <MenuItem  Header="{x:Static p:Resources.DataToolsLocationFieldEditor}" Click="mnuFieldTypeEditor_Click" Command="{Binding ToggleAdminBoundaryFieldEditorCommand}"
                                               Visibility="{Binding Data.ShowColumn, Converter={StaticResource BooleanToVisibilityConverter}, Source={StaticResource proxy}}"/>
                                    <!--<MenuItem Header="Country Value Editor" Click="mnuCountryNameEditor_Click" />
                                    <MenuItem Header="{x:Static p:Resources.DataToolsDistrictValueEditor}" Click="mnuDistrictNameEditor_Click" />-->
                                    <MenuItem Header="Data Consistency Checker" Click="mnuDataChecker_Click" />
                                    <MenuItem Header="Clean Data Tables" Command="{Binding CleanUpDataTablesCommand}" IsEnabled="{Binding IsConnected}" />
                                    <MenuItem Header="Remove All Record Locks" Command="{Binding RemoveAllRecordLocksCommand}" IsEnabled="{Binding IsMultiUser}" />
                                    <MenuItem Header="Update FieldIds in metaFields" Command="{Binding RepairMetaFieldsTableCommand}" IsEnabled="{Binding IsMultiUser}" />
                                    <MenuItem Header="Create MDB Copy" Command="{Binding ShowSqlToMdbCopierCommand}" />
                                    <MenuItem Header="Remove Contacts that Lack Source Cases" Command="{Binding RemoveCaselessContactsCommand}" />
                                </ContextMenu>
                            </wpf:LightOnDarkCircleButton.ContextMenu>
                        </wpf:LightOnDarkCircleButton>
                    </StackPanel>

                    <StackPanel Grid.Column="2" HorizontalAlignment="Center" Margin="4, 0, 0, 0">

                        <wpf:LightOnDarkCircleButton x:Name="btnRefresh" 
                                                     Text="{x:Static p:Resources.Refresh}" 
                                                     PathData="F1 M 38,20.5833C 42.9908,20.5833 47.4912,22.6825 50.6667,26.046L 50.6667,17.4167L 55.4166,22.1667L 55.4167,34.8333L 42.75,34.8333L 38,30.0833L 46.8512,30.0833C 44.6768,27.6539 41.517,26.125 38,26.125C 31.9785,26.125 27.0037,30.6068 26.2296,36.4167L 20.6543,36.4167C 21.4543,27.5397 28.9148,20.5833 38,20.5833 Z M 38,49.875C 44.0215,49.875 48.9963,45.3932 49.7703,39.5833L 55.3457,39.5833C 54.5457,48.4603 47.0852,55.4167 38,55.4167C 33.0092,55.4167 28.5088,53.3175 25.3333,49.954L 25.3333,58.5833L 20.5833,53.8333L 20.5833,41.1667L 33.25,41.1667L 38,45.9167L 29.1487,45.9167C 31.3231,48.3461 34.483,49.875 38,49.875 Z "
                                                          Command="{Binding RepopulateCollectionsCommand}" CommandParameter="{StaticResource True}" /><!--Changing Parameter to True #17287 -->
                    </StackPanel>

                    <StackPanel Grid.Column="3" HorizontalAlignment="Center" Margin="4, 0, 0, 0">
                        <wpf:LightOnDarkCircleButton x:Name="btnSettings" 
                                                     Text="{x:Static p:Resources.Settings}" 
                                                     PathData="F1 M 27.5314,21.8628L 33.0126,19.4224L 34.7616,23.3507C 36.6693,22.9269 38.6044,22.8903 40.4668,23.2026L 42.0083,19.1868L 47.6098,21.337L 46.0683,25.3528C 47.6612,26.3669 49.0747,27.6889 50.2088,29.2803L 54.1371,27.5313L 56.5776,33.0126L 52.6493,34.7616C 53.0731,36.6693 53.1097,38.6043 52.7974,40.4668L 56.8131,42.0083L 54.6629,47.6097L 50.6472,46.0683C 49.6331,47.6613 48.3111,49.0748 46.7197,50.2089L 48.4686,54.1372L 42.9874,56.5776L 41.2384,52.6493C 39.3307,53.0731 37.3957,53.1097 35.5333,52.7974L 33.9918,56.8131L 28.3903,54.6629L 29.9318,50.6472C 28.3388,49.6331 26.9252,48.3111 25.7911,46.7196L 21.8628,48.4686L 19.4224,42.9873L 23.3507,41.2383C 22.9269,39.3307 22.8903,37.3957 23.2026,35.5332L 19.1869,33.9918L 21.3371,28.3903L 25.3528,29.9318C 26.3669,28.3388 27.6889,26.9252 29.2804,25.7911L 27.5314,21.8628 Z M 34.3394,29.7781C 29.7985,31.7998 27.7564,37.1198 29.7781,41.6606C 31.7998,46.2015 37.1198,48.2436 41.6606,46.2219C 46.2015,44.2002 48.2436,38.8802 46.2219,34.3394C 44.2002,29.7985 38.8802,27.7564 34.3394,29.7781 Z "
                                                          Click="btnSettings_Click" />
                    </StackPanel>

                    <StackPanel Grid.Column="4" HorizontalAlignment="Center" Margin="4, 0, 0, 0">
                        <wpf:LightOnDarkCircleButton x:Name="btnCloseProject" Text="{x:Static p:Resources.Close}" 
                                                     PathData="F1 M 26.9166,22.1667L 37.9999,33.25L 49.0832,22.1668L 53.8332,26.9168L 42.7499,38L 53.8332,49.0834L 49.0833,53.8334L 37.9999,42.75L 26.9166,53.8334L 22.1666,49.0833L 33.25,38L 22.1667,26.9167L 26.9166,22.1667 Z "
                                                          Click="btnCloseProject_Click" />
                    </StackPanel>
                </Grid>
            </StackPanel>
        </StackPanel>

        <StackPanel Grid.Row="1">
            <Grid x:Name="grdMenuItems" Margin="0,0,0,0" Grid.Row="1" Grid.Column="1">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*"></ColumnDefinition>
                    <ColumnDefinition Width="*"></ColumnDefinition>
                    <ColumnDefinition Width="*"></ColumnDefinition>
                    <ColumnDefinition Width="*"></ColumnDefinition>
                    <ColumnDefinition Width="*"></ColumnDefinition>
                </Grid.ColumnDefinitions>

                <Grid.RowDefinitions>
                    <RowDefinition MaxHeight="46"></RowDefinition>
                </Grid.RowDefinitions>

                <Controls:TabButton
                    AssociatedPage="{Binding ElementName=gridCaseManagement}"
                    x:Name="tabButtonCases" Grid.Column="0" Margin="0, 0, 0, 0" IsChecked="True" Content="{x:Static p:Resources.TabCaseManagement}" Checked="btnTab_Checked" Unchecked="btnTab_Unchecked" />
                <Controls:TabButton
                    AssociatedPage="{Binding ElementName=gridContacts}"
                    x:Name="tabButtonContacts" Grid.Column="1" Margin="0, 0, 0, 0" IsChecked="False" Content="{x:Static p:Resources.TabContacts}" Checked="btnTab_Checked" Unchecked="btnTab_Unchecked" />
                <Controls:TabButton
                    AssociatedPage="{Binding ElementName=gridHospitalizations}"
                    x:Name="tabButtonHospitalizations" Grid.Column="2" Margin="0, 0, 0, 0" IsChecked="False" Content="{x:Static p:Resources.TabIsolatedPatients}" Checked="btnTab_Checked" Unchecked="btnTab_Unchecked" />
                <Controls:TabButton
                    AssociatedPage="{Binding ElementName=gridAnalysis}"
                    x:Name="tabButtonAnalysis" Grid.Column="3" Margin="0, 0, 0, 0" IsChecked="False" Content="{x:Static p:Resources.TabAnalysis}" Checked="btnTab_Checked" Unchecked="btnTab_Unchecked" />
                <Controls:TabButton
                    AssociatedPage="{Binding ElementName=gridTransmission}"
                    x:Name="tabButtonTransmissionChain" Grid.Column="4" Margin="0, 0, 0, 0" IsChecked="False" Content="{x:Static p:Resources.TabTransmissionChain}" Checked="btnTab_Checked" Unchecked="btnTab_Unchecked" />

                <StackPanel Height="4" Grid.ColumnSpan="100" HorizontalAlignment="Stretch" VerticalAlignment="Top">
                    <StackPanel.Background>
                        <LinearGradientBrush StartPoint="0,0" EndPoint="0,1" >
                            <LinearGradientBrush.GradientStops>
                                <GradientStop Color="#FF9D9D9D" Offset="0" />
                                <GradientStop Color="#009D9D9D" Offset="1.0" />
                                <!--<GradientStop Color="#00F7F7F9" Offset="1.0" />-->
                            </LinearGradientBrush.GradientStops>
                        </LinearGradientBrush>
                    </StackPanel.Background>
                </StackPanel>
                <!--<Controls:MenuItemPanel x:Name="menuPanelCases" Grid.Column="0" Margin="0, 0, 6, 0" HighlightColor="{StaticResource buttonHomeHighlight}" Text="{x:Static p:Resources.TabCaseManagement}" MouseDown="panel_MouseDown" />
                <Controls:MenuItemPanel x:Name="menuPanelContacts" Grid.Column="1" Margin="0, 0, 6, 0" HighlightColor="{StaticResource buttonDataEntryHighlight}" Text="{x:Static p:Resources.TabContacts}" MouseDown="panel_MouseDown" />
                <Controls:MenuItemPanel x:Name="menuPanelHospitalizations" Grid.Column="2" Margin="0, 0, 6, 0" HighlightColor="{StaticResource buttonDataEntryHighlight}" Text="{x:Static p:Resources.TabIsolatedPatients}" MouseDown="panel_MouseDown" />
                <Controls:MenuItemPanel x:Name="menuPanelAnalysis" Grid.Column="3" Margin="0, 0, 6, 0" HighlightColor="{StaticResource buttonDataManagementHighlight}" Text="{x:Static p:Resources.TabAnalysis}" MouseDown="panel_MouseDown" />
                <Controls:MenuItemPanel x:Name="menuPanelTransmission" Grid.Column="4" HighlightColor="{StaticResource buttonDataManagementHighlight}" Text="{x:Static p:Resources.TabTransmissionChain}" MouseDown="panel_MouseDown" />-->
            </Grid>
        </StackPanel>

        <Grid x:Name="gridCaseManagement" Visibility="{Binding IsChecked, ElementName=tabButtonCases, Converter={StaticResource BooleanToVisibilityConverter}}" Background="{StaticResource mainPanelBackgroundBrush}" Grid.Row="3" VerticalAlignment="Stretch">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>

            <StackPanel x:Name="panelCaseManagementSearch" Grid.Row="0" Margin="10,5,0,5">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition />
                        <ColumnDefinition Width="Auto" />
                    </Grid.ColumnDefinitions>
                    <!--<TextBlock Grid.Column="0" FontWeight="Light" Foreground="#585858" FontSize="24" Text="{x:Static p:Resources.CaseManagement}" />-->
                    <!--<TextBlock Grid.Column="0" Style="{StaticResource Heading1}" Text="{x:Static p:Resources.CaseManagement}" />-->
                    <!--<Image Grid.Column="1" Width="20" Height="20" Margin="20,0,20,0" Source="Images\word.png" Cursor="Hand" MouseDown="caseFormPrint_Click"/>-->
                    <Button Click="caseFormPrint_Click" 
                            Visibility="{Binding Data.ShowColumn, Converter={StaticResource BooleanToVisibilityConverter}, Source={StaticResource proxy}}"
                            Margin="10,0,10,0" 
                            HorizontalAlignment="Right" 
                            BorderThickness="0"
                            Style="{StaticResource ResourceKey=BacklessButtonStyle}">
                        <Button.Content>
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto" />
                                    <ColumnDefinition Width="Auto" />
                                </Grid.ColumnDefinitions>
                                <Path Grid.Column="1" Width="20" Height="25" Margin="6, 2, 0, 2" Stretch="Fill" Fill="Black" Data="F1 M 52,34L 39,34L 39,21L 24,21L 24,55L 52,55L 52,34 Z M 55.9999,59L 20,59L 20,17L 43.25,17L 55.9999,29.75L 55.9999,59 Z M 43,22.25L 43,30L 50.7499,30L 43,22.25 Z M 31,53L 31,45L 34,45C 35.6569,45 37,45.8431 37,47.5C 37,49.1569 35.6569,50 34,50L 33,50L 33,53L 31,53 Z M 34,48C 34.5523,48 35,48.0523 35,47.5C 35,46.9477 34.5523,47 34,47L 33,47L 33,48L 34,48 Z M 45,53L 45,45L 50,45L 50,47L 47,47L 47,48L 49,48L 49,50L 47,50L 47,53L 45,53 Z M 38,45L 41,45C 42.6569,45 44,46.3431 44,48L 44,50C 44,51.6568 42.6569,53 41,53L 38,53L 38,45 Z M 42,50L 42,48C 42,47.4477 41.5523,47 41,47L 40,47L 40,51L 41,51C 41.5523,51 42,50.5523 42,50 Z "/>
                                <!--<Path HorizontalAlignment="Center" Grid.Row="0" Margin="6, 2, 6, 2" Width="12" Height="12" Stretch="Fill" Fill="{StaticResource RoundedButtonShapeForegroundBrush}" Data="F1 M 25,27L 25,17L 51,17L 51,27L 47,27L 47,21L 29,21L 29,27L 25,27 Z M 16,28L 60,28L 60,51L 52,51L 52,46L 55,46L 55,33L 21,33L 21,46L 24,46L 24,51L 16,51L 16,28 Z M 25,39L 28,39L 28,52L 35,52L 35,59L 48,59L 48,39L 51,39L 51,62L 33,62L 25,54L 25,39 Z M 46,55L 38,55L 38,52L 46,52L 46,55 Z M 46,49L 30,49L 30,46L 46,46L 46,49 Z M 46,43L 30,43L 30,40L 46,40L 46,43 Z "/>-->
                                <!--<Path HorizontalAlignment="Center" Grid.Row="0" Margin="6, 2, 6, 2" Width="24" Height="24" Stretch="Fill" Fill="{StaticResource RoundedButtonShapeForegroundBrush}" Data="F1 M 38,0.791664C 58.5496,0.791664 75.2083,17.4504 75.2083,38C 75.2083,58.5496 58.5496,75.2083 38,75.2083C 17.4504,75.2083 0.791662,58.5496 0.791662,38C 0.791662,17.4504 17.4504,0.791664 38,0.791664 Z M 38,5.54166C 20.0738,5.54166 5.54167,20.0738 5.54167,38C 5.54167,55.9262 20.0738,70.4583 38,70.4583C 55.9262,70.4583 70.4583,55.9262 70.4583,38C 70.4583,20.0738 55.9262,5.54166 38,5.54166 Z "/>-->

                                <TextBlock VerticalAlignment="Center"  HorizontalAlignment="Center" Grid.Column="0" Margin="0, 0, 0, 0" FontSize="8pt" Text="{x:Static p:Resources.PrintCaseReportForm}" />
                            </Grid>
                        </Button.Content>
                    </Button>
                </Grid>
                <DockPanel Height="8" />
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="*" />
                    </Grid.ColumnDefinitions>
                    <Controls:SearchBox Margin="0, 0, 10, 0" x:Name="casesSearchBox" Grid.Column="1" SearchText="{Binding SearchCasesText,UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}" Search="{Binding SearchCases}" HorizontalAlignment="Right" />
                    <StackPanel Grid.Column="0" Height="Auto" Orientation="Horizontal" x:Name="panelCaseButtons">
                        <!--<TextBlock VerticalAlignment="Center" FontSize="8pt" Foreground="Black" Margin="20, 0, 6, 0">Show:</TextBlock>
                        <Button Style="{StaticResource BacklessButtonStyle}" FontSize="8pt" x:Name="btnCollapse" Margin="3, 0, 3, 0" Click="btnCollapse_Click" Content="Cases Only" />
                        <TextBlock VerticalAlignment="Center" FontSize="8pt" Foreground="Black" Margin="6, 0, 6, 0">|</TextBlock>
                        <Button Style="{StaticResource BacklessButtonStyle}" FontSize="8pt" x:Name="btnExpandContacts" Margin="3, 0, 3, 0" Click="btnExpandContacts_Click" Content="Cases and Contacts" />
                        <TextBlock VerticalAlignment="Center" FontSize="8pt" Foreground="Black" Margin="6, 0, 6, 0">|</TextBlock>
                        <Button Style="{StaticResource BacklessButtonStyle}" FontSize="8pt" x:Name="btnExpandExposures" Margin="3, 0, 3, 0" Click="btnExpandExposures_Click" Content="Cases and Source Cases" />-->

                        <ToggleButton Style="{StaticResource FlatToggleButtonStyle}" 
                                          IsChecked="True"
                                          x:Name="btnCollapse" MinWidth="120" Margin="3" 
                                          Click="btnCollapse_Click" 
                                          Content="{x:Static p:Resources.ShowCasesOnly}" />
                        <ToggleButton Style="{StaticResource FlatToggleButtonStyle}" 
                                          IsChecked="False"
                                          x:Name="btnExpandContacts" MinWidth="120" Margin="3" 
                                          Click="btnExpandContacts_Click" 
                                          Content="{x:Static p:Resources.ShowContacts}" />
                        <ToggleButton Style="{StaticResource FlatToggleButtonStyle}" 
                                          IsChecked="False"
                                          x:Name="btnExpandExposures" MinWidth="120" Margin="3" 
                                          Click="btnExpandExposures_Click" 
                                          Content="{x:Static p:Resources.ShowSourceCases}" />
                    </StackPanel>
                </Grid>


                <!--<Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition />
                        <ColumnDefinition Width="4" />
                        <ColumnDefinition Width="96" />
                        <ColumnDefinition Width="4" />
                        <ColumnDefinition Width="96" />
                    </Grid.ColumnDefinitions>

                    <TextBox x:Name="txtSearch" />
                    <Button x:Name="btnSearch" Grid.Column="2" IsDefault="True" Click="btnSearch_Click">Search Cases</Button>
                    <Button x:Name="btnClearSearch" Grid.Column="4" IsCancel="True" IsEnabled="False" Click="btnClearSearch_Click">Clear Results</Button>
                </Grid>
                <DockPanel Height="24" />-->
                <!--<StackPanel Height="32" Orientation="Horizontal" x:Name="panelCaseButtons">
                    <Button x:Name="btnCollapse" Width="150" Margin="3" Click="btnCollapse_Click" Content="{x:Static p:Resources.ShowCasesOnly}" />
                    <Button x:Name="btnExpandContacts" Width="150" Margin="3" Click="btnExpandContacts_Click" Content="{x:Static p:Resources.ShowContacts}" />
                    <Button x:Name="btnExpandExposures" Width="150" Margin="3" Click="btnExpandExposures_Click" Content="{x:Static p:Resources.ShowSourceCases}" />
                </StackPanel>-->

            </StackPanel>

            <StackPanel x:Name="panelCaseMain" Grid.Column="0" Grid.Row="1" Margin="10,5,10,10" DockPanel.Dock="Top">

                <!--<Border Background="#085CA7">-->
                <!--<Border Background="{StaticResource gridHeaderBrush}">-->
                <Border Background="{StaticResource DataGridHeaderBackgroundBrush}">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition/>
                            <ColumnDefinition Width="Auto"/>
                        </Grid.ColumnDefinitions>
                        <!--<Rectangle Grid.ColumnSpan="2" Height="4" VerticalAlignment="Top" Fill="{StaticResource AccentBrush}" />-->
                        <StackPanel Orientation="Horizontal" Grid.Column="0">
                            <TextBlock Margin="5, 5, 15, 5" FontWeight="SemiBold" FontSize="16" Foreground="{StaticResource DataGridHeaderForegroundBrush}" Text="{x:Static p:Resources.Cases}" />

                            <TextBlock Margin="5, 5, 0, 5" FontWeight="SemiBold" FontSize="16" Foreground="{StaticResource DataGridHeaderForegroundBrush}">(</TextBlock>
                            <TextBlock Margin="0, 5, 0, 5" FontWeight="SemiBold" FontSize="16" Foreground="{StaticResource DataGridHeaderForegroundBrush}" Text="{Binding Path=CaseCollectionView.Count}"></TextBlock>
                            <TextBlock Margin="0, 5, 5, 5" FontWeight="SemiBold" FontSize="16" Foreground="{StaticResource DataGridHeaderForegroundBrush}">)</TextBlock>
                        </StackPanel>
                        <StackPanel Grid.Column="1" Margin="2" Orientation="Horizontal">

                            <wpf:DarkOnLightCircleButton x:Name="btnAddCase" Margin="1"
                                                         Click="btnAddCase_Click"
                                                         Command="{Binding AddCaseShortFormCommand}"
                                                         Text="{x:Static p:Resources.AddCase}"
                                                         PathData="F1 M 35,19L 41,19L 41,35L 57,35L 57,41L 41,41L 41,57L 35,57L 35,41L 19,41L 19,35L 35,35L 35,19 Z "
                                                         />
                            <!--<Button x:Name="btnAddCase" Margin="1" 
                                    Style="{StaticResource RoundedButtonStyle}" 
                                    Click="btnAddCase_Click">
                                <Button.Content>
                                    <Grid>
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="Auto" />
                                            <ColumnDefinition Width="Auto" />
                                        </Grid.ColumnDefinitions>
                                        <Path HorizontalAlignment="Center" Grid.Row="0" Margin="6, 2, 6, 2" Width="12" Height="12" Stretch="Fill" Fill="{StaticResource RoundedButtonShapeForegroundBrush}" Data="F1 M 35,19L 41,19L 41,35L 57,35L 57,41L 41,41L 41,57L 35,57L 35,41L 19,41L 19,35L 35,35L 35,19 Z "/>
                                        <Path HorizontalAlignment="Center" Grid.Row="0" Margin="6, 2, 6, 2" Width="24" Height="24" Stretch="Fill" Fill="{StaticResource RoundedButtonShapeForegroundBrush}" Data="F1 M 38,0.791664C 58.5496,0.791664 75.2083,17.4504 75.2083,38C 75.2083,58.5496 58.5496,75.2083 38,75.2083C 17.4504,75.2083 0.791662,58.5496 0.791662,38C 0.791662,17.4504 17.4504,0.791664 38,0.791664 Z M 38,5.54166C 20.0738,5.54166 5.54167,20.0738 5.54167,38C 5.54167,55.9262 20.0738,70.4583 38,70.4583C 55.9262,70.4583 70.4583,55.9262 70.4583,38C 70.4583,20.0738 55.9262,5.54166 38,5.54166 Z "/>

                                        <TextBlock VerticalAlignment="Center"  HorizontalAlignment="Center" Grid.Column="1" Margin="0, 0, 10, 0" FontSize="8pt" Text="{x:Static p:Resources.AddCase}"></TextBlock>
                                    </Grid>
                                </Button.Content>
                            </Button>-->

                            <wpf:DarkOnLightCircleButton x:Name="btnImport" Margin="1"
                                                         Click="btnImportCases_Click"
                                                         Text="{x:Static p:Resources.Import}"
                                                         PathData="F1 M 35,13L 35,30.5L 27,21L 27,30.75L 38,43.25L 49,30.75L 49,21L 41,30.5L 41,13L 35,13 Z M 17,38L 30,38L 33.75,42L 21,42L 21,53L 55,53L 55,42L 42.25,42L 46,38L 59,38L 59,57L 17,57L 17,38 Z M 33,46L 43,46L 43,49L 33,49L 33,46 Z "
                                                         >
                                <!--<wpf:DarkOnLightCircleButton.ContextMenu>
                                    <ContextMenu>
                                        <MenuItem Header="Import data sync file" Click="btnImportCaseSyncFile_Click"></MenuItem>
                                        <MenuItem Header="{x:Static p:Resources.ImportLab}" Click="btnImportLab_Click"></MenuItem>                                        
                                    </ContextMenu>
                                </wpf:DarkOnLightCircleButton.ContextMenu>-->
                            </wpf:DarkOnLightCircleButton>

                            <!--<Button x:Name="btnImport" Margin="1" Style="{StaticResource RoundedButtonStyle}" Click="btnImportCases_Click">
                                
                                <Button.ContextMenu>
                                    <ContextMenu>
                                        <MenuItem Header="{x:Static p:Resources.ImportLab}" Click="btnImportLab_Click"></MenuItem>
                                    </ContextMenu>
                                </Button.ContextMenu>
                                
                                <Button.Content>
                                    <Grid>
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="Auto" />
                                            <ColumnDefinition Width="Auto" />
                                        </Grid.ColumnDefinitions>
                                        
                                        <Path HorizontalAlignment="Center" Grid.Row="0" Margin="6, 2, 6, 2" Width="12" Height="12" Stretch="Fill" Fill="{StaticResource RoundedButtonShapeForegroundBrush}" Data="F1 M 35,13L 35,30.5L 27,21L 27,30.75L 38,43.25L 49,30.75L 49,21L 41,30.5L 41,13L 35,13 Z M 17,38L 30,38L 33.75,42L 21,42L 21,53L 55,53L 55,42L 42.25,42L 46,38L 59,38L 59,57L 17,57L 17,38 Z M 33,46L 43,46L 43,49L 33,49L 33,46 Z "/>
                                        <Path HorizontalAlignment="Center" Grid.Row="0" Margin="6, 2, 6, 2" Width="24" Height="24" Stretch="Fill" Fill="{StaticResource RoundedButtonShapeForegroundBrush}" Data="F1 M 38,0.791664C 58.5496,0.791664 75.2083,17.4504 75.2083,38C 75.2083,58.5496 58.5496,75.2083 38,75.2083C 17.4504,75.2083 0.791662,58.5496 0.791662,38C 0.791662,17.4504 17.4504,0.791664 38,0.791664 Z M 38,5.54166C 20.0738,5.54166 5.54167,20.0738 5.54167,38C 5.54167,55.9262 20.0738,70.4583 38,70.4583C 55.9262,70.4583 70.4583,55.9262 70.4583,38C 70.4583,20.0738 55.9262,5.54166 38,5.54166 Z "/>

                                        <TextBlock VerticalAlignment="Center"  HorizontalAlignment="Center" Grid.Column="1" Margin="0, 0, 10, 0" FontSize="8pt" Text="{x:Static p:Resources.Import}"></TextBlock>
                                    </Grid>
                                </Button.Content>
                                
                            </Button>-->

                            <!--<TextBlock Text="{x:Static p:Resources.ImportLab}" />-->

                            <!--<Button x:Name="btnExportLab" Margin="1" Height="20" Style="{StaticResource FlatButtonStyle}" Click="btnExportCases2_Click">
                                <TextBlock>Export Lab</TextBlock>
                            </Button>-->

                            <wpf:DarkOnLightCircleButton x:Name="btnExport" Margin="1"
                                                         Click="btnExportCases_Click"
                                                         Text="{x:Static p:Resources.Export}"
                                                         PathData="F1 M 35,43L 35,25.5L 27,35L 27,25.25L 38,12.75L 49,25.25L 49,35L 41,25.5L 41,43L 35,43 Z M 17,38L 33,38L 33,42L 21,42L 21,53L 55,53L 55,42L 43,42L 43,38L 59,38L 59,57L 17,57L 17,38 Z M 33,46L 43,46L 43,49L 33,49L 33,46 Z "
                                                         >
                                <wpf:DarkOnLightCircleButton.ContextMenu>
                                    <ContextMenu>
                                        <MenuItem Header="{x:Static p:Resources.ExportForAnalysis}" Click="btnExportForAnalysis_Click"></MenuItem>
                                        <MenuItem Header="{x:Static p:Resources.ExportForViewing}" Click="btnExportForViewing_Click"
                                                  Visibility="{Binding Data.ShowColumn, 
                            Converter={StaticResource BooleanToVisibilityConverter}, Source={StaticResource proxy}}"></MenuItem>
                                        <Separator />
                                        <MenuItem Header="Export data sync file" Command="{Binding ShowSyncFileExporterCommand}" ></MenuItem>
                                    </ContextMenu>
                                </wpf:DarkOnLightCircleButton.ContextMenu>
                            </wpf:DarkOnLightCircleButton>

                            <!--<Button x:Name="btnExport" Margin="1" Style="{StaticResource RoundedButtonStyle}" Click="btnExportCases_Click">
                                <Button.ContextMenu>
                                    <ContextMenu>
                                        <MenuItem Header="{x:Static p:Resources.ExportForAnalysis}" Click="btnExportForAnalysis_Click"></MenuItem>
                                        <MenuItem Header="{x:Static p:Resources.ExportForViewing}" Click="btnExportForViewing_Click"></MenuItem>
                                    </ContextMenu>
                                </Button.ContextMenu>
                                <Button.Content>
                                    <Grid>
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="Auto" />
                                            <ColumnDefinition Width="Auto" />
                                        </Grid.ColumnDefinitions>
                                        <Path HorizontalAlignment="Center" Grid.Row="0" Margin="6, 2, 6, 2" Width="12" Height="12" Stretch="Fill" Fill="{StaticResource RoundedButtonShapeForegroundBrush}" Data="F1 M 35,43L 35,25.5L 27,35L 27,25.25L 38,12.75L 49,25.25L 49,35L 41,25.5L 41,43L 35,43 Z M 17,38L 33,38L 33,42L 21,42L 21,53L 55,53L 55,42L 43,42L 43,38L 59,38L 59,57L 17,57L 17,38 Z M 33,46L 43,46L 43,49L 33,49L 33,46 Z "/>
                                        <Path HorizontalAlignment="Center" Grid.Row="0" Margin="6, 2, 6, 2" Width="24" Height="24" Stretch="Fill" Fill="{StaticResource RoundedButtonShapeForegroundBrush}" Data="F1 M 38,0.791664C 58.5496,0.791664 75.2083,17.4504 75.2083,38C 75.2083,58.5496 58.5496,75.2083 38,75.2083C 17.4504,75.2083 0.791662,58.5496 0.791662,38C 0.791662,17.4504 17.4504,0.791664 38,0.791664 Z M 38,5.54166C 20.0738,5.54166 5.54167,20.0738 5.54167,38C 5.54167,55.9262 20.0738,70.4583 38,70.4583C 55.9262,70.4583 70.4583,55.9262 70.4583,38C 70.4583,20.0738 55.9262,5.54166 38,5.54166 Z "/>

                                        <TextBlock VerticalAlignment="Center"  HorizontalAlignment="Center" Grid.Column="1" Margin="0, 0, 10, 0" FontSize="8pt" Text="{x:Static p:Resources.Export}"></TextBlock>
                                    </Grid>
                                </Button.Content>
                            </Button>-->

                            <wpf:DarkOnLightCircleButton x:Name="btnPrintCases" Margin="1"
                                                         Click="btnPrintCases_Click"
                                                         Text="{x:Static p:Resources.Print}"
                                                         PathData="F1 M 25,27L 25,17L 51,17L 51,27L 47,27L 47,21L 29,21L 29,27L 25,27 Z M 16,28L 60,28L 60,51L 52,51L 52,46L 55,46L 55,33L 21,33L 21,46L 24,46L 24,51L 16,51L 16,28 Z M 25,39L 28,39L 28,52L 35,52L 35,59L 48,59L 48,39L 51,39L 51,62L 33,62L 25,54L 25,39 Z M 46,55L 38,55L 38,52L 46,52L 46,55 Z M 46,49L 30,49L 30,46L 46,46L 46,49 Z M 46,43L 30,43L 30,40L 46,40L 46,43 Z "
                                                         >
                                <wpf:DarkOnLightCircleButton.ContextMenu>
                                    <ContextMenu>
                                        <MenuItem Header="{x:Static p:Resources.PrintAllCaseRecords}" Click="btnPrintCurrentCases_Click"></MenuItem>
                                        <MenuItem Header="{x:Static p:Resources.PrintAliveSuspectProbableCaseRecords}" Click="btnPrintAliveSuspectProbableCases_Click"></MenuItem>
                                        <MenuItem Header="{x:Static p:Resources.PrintCasesWithoutContacts}" Click="btnPrintCasesMissingContacts_Click" />
                                    </ContextMenu>
                                </wpf:DarkOnLightCircleButton.ContextMenu>
                            </wpf:DarkOnLightCircleButton>
                            <!--<Button x:Name="btnPrintCases" Margin="1" Style="{StaticResource RoundedButtonStyle}" Click="btnPrintCases_Click">
                                <Button.ContextMenu>
                                    <ContextMenu>
                                        <MenuItem Header="{x:Static p:Resources.PrintAllCaseRecords}" Click="btnPrintCurrentCases_Click"></MenuItem>
                                        <MenuItem Header="{x:Static p:Resources.PrintAliveSuspectProbableCaseRecords}" Click="btnPrintAliveSuspectProbableCases_Click"></MenuItem>
                                        <MenuItem Header="{x:Static p:Resources.PrintEpiCaseClassChanges}" Click="btnPrintChangedCases_Click"></MenuItem>
                                        <MenuItem Header="{x:Static p:Resources.PrintCasesWithoutContacts}" Click="btnPrintCasesMissingContacts_Click" />
                                    </ContextMenu>
                                </Button.ContextMenu>
                                <Button.Content>
                                    <Grid>
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="Auto" />
                                            <ColumnDefinition Width="Auto" />
                                        </Grid.ColumnDefinitions>
                                        <Path HorizontalAlignment="Center" Grid.Row="0" Margin="6, 2, 6, 2" Width="12" Height="12" Stretch="Fill" Fill="{StaticResource RoundedButtonShapeForegroundBrush}" Data="F1 M 25,27L 25,17L 51,17L 51,27L 47,27L 47,21L 29,21L 29,27L 25,27 Z M 16,28L 60,28L 60,51L 52,51L 52,46L 55,46L 55,33L 21,33L 21,46L 24,46L 24,51L 16,51L 16,28 Z M 25,39L 28,39L 28,52L 35,52L 35,59L 48,59L 48,39L 51,39L 51,62L 33,62L 25,54L 25,39 Z M 46,55L 38,55L 38,52L 46,52L 46,55 Z M 46,49L 30,49L 30,46L 46,46L 46,49 Z M 46,43L 30,43L 30,40L 46,40L 46,43 Z "/>
                                        <Path HorizontalAlignment="Center" Grid.Row="0" Margin="6, 2, 6, 2" Width="24" Height="24" Stretch="Fill" Fill="{StaticResource RoundedButtonShapeForegroundBrush}" Data="F1 M 38,0.791664C 58.5496,0.791664 75.2083,17.4504 75.2083,38C 75.2083,58.5496 58.5496,75.2083 38,75.2083C 17.4504,75.2083 0.791662,58.5496 0.791662,38C 0.791662,17.4504 17.4504,0.791664 38,0.791664 Z M 38,5.54166C 20.0738,5.54166 5.54167,20.0738 5.54167,38C 5.54167,55.9262 20.0738,70.4583 38,70.4583C 55.9262,70.4583 70.4583,55.9262 70.4583,38C 70.4583,20.0738 55.9262,5.54166 38,5.54166 Z "/>

                                        <TextBlock VerticalAlignment="Center"  HorizontalAlignment="Center" Grid.Column="1" Margin="0, 0, 10, 0" FontSize="8pt" Text="{x:Static p:Resources.Print}"></TextBlock>
                                    </Grid>
                                </Button.Content>
                            </Button>-->
                        </StackPanel>
                    </Grid>
                </Border>

                <DataGrid x:Name="dgCases" VerticalAlignment="Stretch"
                          ItemsSource="{Binding CaseCollectionView, Mode=Default, IsAsync=True, FallbackValue=...}"
                          IsSynchronizedWithCurrentItem="True"
                          ScrollViewer.PanningMode="Both"
                            VirtualizingStackPanel.IsVirtualizing="True"
                            VirtualizingStackPanel.VirtualizationMode="Recycling"
                      Style="{StaticResource DataGridDemoStyle}"
                          EnableColumnVirtualization="False"
                          EnableRowVirtualization="True"
                          AutoGenerateColumns="False"
                          CanUserReorderColumns="False"
                          MouseRightButtonUp="dgCases_MouseRightButtonUp"
                      SelectionChanged="dgCases_SelectionChanged" MouseDoubleClick="dgCases_MouseDoubleClick">

                    <DataGrid.Columns>
                        <DataGridTemplateColumn Header="Actions">
                            <DataGridTemplateColumn.CellTemplate>
                                <DataTemplate>
                                    <Controls:CaseActionsRowControl DataContext="{Binding}" 
                                                                    ShowConvertButton="True"
                                                                    ShowDeleteButton="True"
                                                                    ShowPrintButton="{Binding Data.IsCountryUS, Converter={StaticResource BooleanInverter}, Source={StaticResource proxy}}"
                                                                    ShowLabButton="True"
                                                                    ShowRelationshipButton="False"
                                                                    DeleteRequested="carc_DeleteRequested"
                                                                    PrintFullFormRequested="carc_PrintFullFormRequested"
                                                                    PrintOutcomeFormRequested="carc_PrintOutcomeFormRequested"
                                                                    ConversionToContactRequested="carc_ConversionToContactRequested"
                                                                    ListLabSamplesRequested="carc_ListLabSamplesRequested"
                                                                    ForceUnlockRequested="carc_ForceUnlockRequested"
                                                                     />
                                </DataTemplate>
                            </DataGridTemplateColumn.CellTemplate>
                        </DataGridTemplateColumn>
                        <DataGridTemplateColumn Header="">
                            <DataGridTemplateColumn.CellTemplate>
                                <DataTemplate>
                                    <StackPanel Orientation="Horizontal" Background="Transparent" MouseLeftButtonDown="ForceUnlockCaseRequested">
                                        
                                        <Path Width="12" 
                                          Height="12" 
                                          Stretch="Fill" 
                                          Visibility="{Binding IsLocked, Converter={StaticResource BooleanToVisibilityConverter}, FallbackValue=Collapsed}"
                                        Data="F1 M 22.17,36.4216L 25.3369,36.4216L 25.3369,31.6711C 25.3369,24.6745 31.0087,19.0027 38.0053,19.0027C 45.0019,19.0027 50.6737,24.6745 50.6737,31.6711L 50.6737,36.4216L 53.841,36.4216L 53.8411,57.008L 22.17,57.008L 22.17,36.4216 Z M 45.9231,31.6711C 45.9231,27.2982 42.3782,23.7533 38.0053,23.7533C 33.6324,23.7533 30.0875,27.2982 30.0875,31.6711L 30.0875,36.4216L 45.923,36.4216L 45.9231,31.6711 Z">
                                            <Path.Style>
                                                <Style TargetType="{x:Type Path}">
                                                    <Setter Property="Fill" Value="{StaticResource HighlightBrush}" />
                                                    <Style.Triggers>
                                                        <DataTrigger
                                                                Binding="{Binding
                                                                    RelativeSource={RelativeSource
                                                                        Mode=FindAncestor,
                                                                        AncestorType={x:Type DataGridCell}},
                                                                        Path=IsSelected}"
                                                                Value="True">
                                                            <Setter Property="Fill" Value="White"/>
                                                        </DataTrigger>
                                                    </Style.Triggers>
                                                </Style>
                                            </Path.Style>
                                        </Path>

                                        <!--<Path Width="12" 
                                          Height="12" 
                                          Stretch="Fill" 
                                              ToolTipService.InitialShowDelay="0"
                                          Visibility="{Binding IsInvalidId, Converter={StaticResource BooleanToVisibilityConverter}, FallbackValue=Collapsed}"
                                        Data="F1 M 58.5832,55.4172L 17.4169,55.4171C 15.5619,53.5621 15.5619,50.5546 17.4168,48.6996L 35.201,15.8402C 37.056,13.9852 40.0635,13.9852 41.9185,15.8402L 58.5832,48.6997C 60.4382,50.5546 60.4382,53.5622 58.5832,55.4172 Z M 34.0417,25.7292L 36.0208,41.9584L 39.9791,41.9583L 41.9583,25.7292L 34.0417,25.7292 Z M 38,44.3333C 36.2511,44.3333 34.8333,45.7511 34.8333,47.5C 34.8333,49.2489 36.2511,50.6667 38,50.6667C 39.7489,50.6667 41.1666,49.2489 41.1666,47.5C 41.1666,45.7511 39.7489,44.3333 38,44.3333 Z">
                                            <Path.Style>
                                                <Style TargetType="{x:Type Path}">
                                                    <Setter Property="Fill" Value="Tomato" />
                                                    <Style.Triggers>
                                                        <DataTrigger
                                                                Binding="{Binding
                                                                    RelativeSource={RelativeSource
                                                                        Mode=FindAncestor,
                                                                        AncestorType={x:Type DataGridCell}},
                                                                        Path=IsSelected}"
                                                                Value="True">
                                                            <Setter Property="Fill" Value="White"/>
                                                        </DataTrigger>
                                                    </Style.Triggers>
                                                </Style>
                                            </Path.Style>
                                            <Path.ToolTip>
                                                <TextBlock>The ID for this case is invalid.</TextBlock>
                                            </Path.ToolTip>
                                        </Path>-->

                                        <Path Width="12" Height="12" Stretch="Fill" ToolTipService.InitialShowDelay="0"
                                          Visibility="{Binding IsDuplicateId, Converter={StaticResource BooleanToVisibilityConverter}, FallbackValue=Collapsed}"
                                        Data="F1 M 58.5832,55.4172L 17.4169,55.4171C 15.5619,53.5621 15.5619,50.5546 17.4168,48.6996L 35.201,15.8402C 37.056,13.9852 40.0635,13.9852 41.9185,15.8402L 58.5832,48.6997C 60.4382,50.5546 60.4382,53.5622 58.5832,55.4172 Z M 34.0417,25.7292L 36.0208,41.9584L 39.9791,41.9583L 41.9583,25.7292L 34.0417,25.7292 Z M 38,44.3333C 36.2511,44.3333 34.8333,45.7511 34.8333,47.5C 34.8333,49.2489 36.2511,50.6667 38,50.6667C 39.7489,50.6667 41.1666,49.2489 41.1666,47.5C 41.1666,45.7511 39.7489,44.3333 38,44.3333 Z">
                                            <Path.Style>
                                                <Style TargetType="{x:Type Path}">
                                                    <Setter Property="Fill" Value="Tomato" />
                                                    <Style.Triggers>
                                                        <DataTrigger
                                                                Binding="{Binding
                                                                    RelativeSource={RelativeSource
                                                                        Mode=FindAncestor,
                                                                        AncestorType={x:Type DataGridCell}},
                                                                        Path=IsSelected}"
                                                                Value="True">
                                                            <Setter Property="Fill" Value="White"/>
                                                        </DataTrigger>
                                                    </Style.Triggers>
                                                </Style>
                                            </Path.Style>
                                            <Path.ToolTip>
                                                <TextBlock Text="{x:Static p:Resources.DuplicateCaseID}"></TextBlock>
                                            </Path.ToolTip>
                                        </Path>


                                    </StackPanel>
                                </DataTemplate>
                            </DataGridTemplateColumn.CellTemplate>
                        </DataGridTemplateColumn>

                        <DataGridTextColumn Header="" Binding="{Binding IsContactSymbol}" IsReadOnly="True" />
                        <DataGridTextColumn Binding="{Binding ID, ValidatesOnNotifyDataErrors=False}" IsReadOnly="True">
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderID}">
                                    </TextBlock>
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn>
                        <DataGridTextColumn Binding="{Binding OriginalID}" IsReadOnly="True" Visibility="{Binding Data.IsCountryUS, 
                            Converter={StaticResource BooleanToVisibilityConverter}, Source={StaticResource proxy}}">
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderOriginalID}" />
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn>
                        <DataGridTextColumn Binding="{Binding Surname}" IsReadOnly="True" >
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderSurname}" />
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn>
                        <DataGridTextColumn Binding="{Binding OtherNames}" IsReadOnly="True">
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderOtherNames}" />
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn>

                        <DataGridTextColumn Binding="{Binding EpiCaseDef, ValidatesOnNotifyDataErrors=False, Converter={StaticResource EpiCaseClassificationConverter}}" IsReadOnly="True">
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderEpiCaseDef}">
                                    </TextBlock>
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn>
                        <DataGridTextColumn Header="{x:Static p:Resources.ColHeaderGender}" Binding="{Binding Gender, ValidatesOnDataErrors=False, Converter={StaticResource GenderConverter}}" IsReadOnly="True" >
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderGender}" />
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn>
                        <DataGridTextColumn Binding="{Binding AgeYears}" IsReadOnly="True" >
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderAge}" />
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn>
                        <!--Binding="{Binding DateOnset, StringFormat='dd/MM/yyyy', ValidatesOnNotifyDataErrors=False, NotifyOnValidationError=False}"-->
                        <DataGridTextColumn  IsReadOnly="True" SortMemberPath="DateOnset">
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderOnsetDate}">
                                    </TextBlock>
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                            <DataGridTextColumn.Binding>
                                <MultiBinding Converter="{StaticResource DateConverter}" >
                                    <Binding Path="DataContext.DateOnset" RelativeSource="{RelativeSource Self}"/>
                                    <Binding Path="DataContext.ApplicationCulture" RelativeSource="{RelativeSource  AncestorType={x:Type Window}}"/>
                                </MultiBinding>
                            </DataGridTextColumn.Binding>
                        </DataGridTextColumn>
                        <DataGridTextColumn Binding="{Binding CurrentStatus}" IsReadOnly="True">
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderCurrentStatus}">
                                    </TextBlock>
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn>
                        <!--Binding="{Binding DateDeathCurrentOrFinal, StringFormat='dd/MM/yyyy', ValidatesOnNotifyDataErrors=False, NotifyOnValidationError=False}"-->
                        <DataGridTextColumn  IsReadOnly="True" SortMemberPath="DateDeathCurrentOrFinal">
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderDeathDate}" />
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                            <DataGridTextColumn.Binding>
                                <MultiBinding Converter="{StaticResource DateConverter}" >
                                    <Binding Path="DataContext.DateDeathCurrentOrFinal" RelativeSource="{RelativeSource Self}"/>
                                    <Binding Path="DataContext.ApplicationCulture" RelativeSource="{RelativeSource  AncestorType={x:Type Window}}"/>
                                </MultiBinding>
                            </DataGridTextColumn.Binding>
                        </DataGridTextColumn>
                        <DataGridTextColumn Binding="{Binding IsHCW, Converter={StaticResource HCWConverter}}" IsReadOnly="True" >
                            <!--17179-->
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderIsHCW}" />
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn>
                        <DataGridTextColumn Header="{x:Static p:Resources.ColHeaderVillage}" Binding="{Binding Village}" IsReadOnly="True">
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <!--<TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderVillage}" />-->
                                    <TextBlock TextAlignment="Center" Text="{Binding RelativeSource={RelativeSource
                                Mode=FindAncestor,
                                AncestorType={x:Type Window}},
                                Path=DataContext.Adm4}" />
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn>
                        <DataGridTextColumn Header="{x:Static p:Resources.ColHeaderParish}" Binding="{Binding Parish}" IsReadOnly="True" Visibility="{Binding Data.ShowColumn, 
                            Converter={StaticResource BooleanToVisibilityConverter}, Source={StaticResource proxy}}">
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{Binding RelativeSource={RelativeSource
                                Mode=FindAncestor,
                                AncestorType={x:Type Window}},
                                Path=DataContext.Adm3}" />
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn>
                        <DataGridTextColumn Header="{x:Static p:Resources.ColHeaderSubCounty}" Binding="{Binding SubCounty}" IsReadOnly="True">
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <!--<TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderSubCounty}" />-->
                                    <TextBlock TextAlignment="Center" Text="{Binding RelativeSource={RelativeSource
                                Mode=FindAncestor,
                                AncestorType={x:Type Window}},
                                Path=DataContext.Adm2}" />
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn>
                        <DataGridTextColumn Header="{x:Static p:Resources.ColHeaderDistrict}" Binding="{Binding District}" IsReadOnly="True" >
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <!--<TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderDistrict}" />-->

                                    <TextBlock TextAlignment="Center" Text="{Binding RelativeSource={RelativeSource
                                Mode=FindAncestor,
                                AncestorType={x:Type Window}},
                                Path=DataContext.Adm1}" />
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn>
                        <DataGridTextColumn Header="{x:Static p:Resources.ColHeaderCountry}" Binding="{Binding Country}" IsReadOnly="True" >
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderCountry}" />
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn>
                        <DataGridTextColumn Binding="{Binding DistrictOnset}" IsReadOnly="True">
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <!--<TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderDistrictOnset}" />-->
                                    <TextBlock TextAlignment="Center" Text="{Binding RelativeSource={RelativeSource
                                Mode=FindAncestor,
                                AncestorType={x:Type Window}},
                                Path=DataContext.Adm1Onset}" />
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn>
                        <DataGridTextColumn Binding="{Binding CountryOnset}" IsReadOnly="True">
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderCountryOnset}" />
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn>
                        <DataGridTextColumn Binding="{Binding Citizenship}" IsReadOnly="True" Visibility="{Binding Data.IsCountryUS, 
                            Converter={StaticResource BooleanToVisibilityConverter}, Source={StaticResource proxy}}">
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderCitizenship}" />
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn>
                        <!--Binding="{Binding DateIsolationCurrent, StringFormat='dd/MM/yyyy', ValidatesOnNotifyDataErrors=False, NotifyOnValidationError=False}"-->
                        <DataGridTextColumn  IsReadOnly="True" SortMemberPath="DateIsolationCurrent">
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderDateIso}">
                                    </TextBlock>
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                            <DataGridTextColumn.Binding>
                                <MultiBinding Converter="{StaticResource DateConverter}" >
                                    <Binding Path="DataContext.DateIsolationCurrent" RelativeSource="{RelativeSource Self}"/>
                                    <Binding Path="DataContext.ApplicationCulture" RelativeSource="{RelativeSource  AncestorType={x:Type Window}}"/>
                                </MultiBinding>
                            </DataGridTextColumn.Binding>
                        </DataGridTextColumn>
                        <!--Binding="{Binding DateDischargeIso, StringFormat='dd/MM/yyyy', ValidatesOnNotifyDataErrors=False, NotifyOnValidationError=False}"-->
                        <DataGridTextColumn  IsReadOnly="True" SortMemberPath="DateDischargeIso">
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderDateDischargeIso}">
                                    </TextBlock>
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                            <DataGridTextColumn.Binding>
                                <MultiBinding Converter="{StaticResource DateConverter}" >
                                    <Binding Path="DataContext.DateDischargeIso" RelativeSource="{RelativeSource Self}"/>
                                    <Binding Path="DataContext.ApplicationCulture" RelativeSource="{RelativeSource  AncestorType={x:Type Window}}"/>
                                </MultiBinding>
                            </DataGridTextColumn.Binding>
                        </DataGridTextColumn>
                        <DataGridTextColumn Binding="{Binding FinalLabClass, Converter={StaticResource FinalLabClassificationConverter}}" IsReadOnly="True">
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderFinalLabClass}">
                                    </TextBlock>
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn>
                        <DataGridTextColumn Header="{x:Static p:Resources.ColHeaderRecStatus}" Binding="{Binding RecordStatus}" IsReadOnly="True"></DataGridTextColumn>

                    </DataGrid.Columns>
                </DataGrid>

                <DockPanel Height="10" />

                <Border x:Name="borderContacts" Visibility="Collapsed" Background="{StaticResource DataGridHeaderBackgroundBrush}" >
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition/>
                            <ColumnDefinition Width="Auto"/>
                        </Grid.ColumnDefinitions>

                        <StackPanel Orientation="Horizontal" Grid.Column="0">
                            <TextBlock Margin="5, 5, 15, 5" FontWeight="SemiBold" FontSize="16" Foreground="{StaticResource DataGridHeaderForegroundBrush}" Text="{x:Static p:Resources.Contacts}"></TextBlock>

                            <TextBlock Margin="5, 5, 0, 5" FontWeight="SemiBold" FontSize="16" Foreground="{StaticResource DataGridHeaderForegroundBrush}">(</TextBlock>
                            <TextBlock Margin="0, 5, 0, 5" FontWeight="SemiBold" FontSize="16" Foreground="{StaticResource DataGridHeaderForegroundBrush}" Text="{Binding Path=CurrentContactLinkCollection.Count}"></TextBlock>
                            <TextBlock Margin="0, 5, 5, 5" FontWeight="SemiBold" FontSize="16" Foreground="{StaticResource DataGridHeaderForegroundBrush}">)</TextBlock>
                        </StackPanel>

                        <StackPanel Margin="2" Orientation="Horizontal" Grid.Column="1" >

                            <wpf:DarkOnLightCircleButton x:Name="btnAddContact" Margin="1"
                                                         Click="btnAddContact_Click"
                                                         IsEnabled="{Binding CaseCollectionView.CurrentPosition, Converter={StaticResource SelectedItemToEnabledConverter}}"
                                                         Text="{x:Static p:Resources.AddContact}"
                                                         PathData="F1 M 35,19L 41,19L 41,35L 57,35L 57,41L 41,41L 41,57L 35,57L 35,41L 19,41L 19,35L 35,35L 35,19 Z "
                                                         >
                                <wpf:DarkOnLightCircleButton.ContextMenu>
                                    <ContextMenu>
                                        <MenuItem Header="{x:Static p:Resources.NewContact}" Click="btnAddNewContact_Click"></MenuItem>
                                        <MenuItem Header="{x:Static p:Resources.ExistingContact}" Click="btnAddExistingContact_Click"></MenuItem>
                                    </ContextMenu>
                                </wpf:DarkOnLightCircleButton.ContextMenu>
                            </wpf:DarkOnLightCircleButton>

                            <!--<Button x:Name="btnAddContact" Margin="1" Style="{StaticResource RoundedButtonStyle}" Click="btnAddContact_Click">
                                <Button.ContextMenu>
                                    <ContextMenu>
                                        <MenuItem Header="{x:Static p:Resources.NewContact}" Click="btnAddNewContact_Click"></MenuItem>
                                        <MenuItem Header="{x:Static p:Resources.ExistingContact}" Click="btnAddExistingContact_Click"></MenuItem>
                                    </ContextMenu>
                                </Button.ContextMenu>
                                <Button.Content>
                                    <Grid>
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="Auto" />
                                            <ColumnDefinition Width="Auto" />
                                        </Grid.ColumnDefinitions>
                                        <Path HorizontalAlignment="Center" Grid.Row="0" Margin="6, 2, 6, 2" Width="12" Height="12" Stretch="Fill" Fill="{StaticResource RoundedButtonShapeForegroundBrush}" Data="F1 M 35,19L 41,19L 41,35L 57,35L 57,41L 41,41L 41,57L 35,57L 35,41L 19,41L 19,35L 35,35L 35,19 Z "/>
                                        <Path HorizontalAlignment="Center" Grid.Row="0" Margin="6, 2, 6, 2" Width="24" Height="24" Stretch="Fill" Fill="{StaticResource RoundedButtonShapeForegroundBrush}" Data="F1 M 38,0.791664C 58.5496,0.791664 75.2083,17.4504 75.2083,38C 75.2083,58.5496 58.5496,75.2083 38,75.2083C 17.4504,75.2083 0.791662,58.5496 0.791662,38C 0.791662,17.4504 17.4504,0.791664 38,0.791664 Z M 38,5.54166C 20.0738,5.54166 5.54167,20.0738 5.54167,38C 5.54167,55.9262 20.0738,70.4583 38,70.4583C 55.9262,70.4583 70.4583,55.9262 70.4583,38C 70.4583,20.0738 55.9262,5.54166 38,5.54166 Z "/>

                                        <TextBlock VerticalAlignment="Center"  HorizontalAlignment="Center" Grid.Column="1" Margin="0, 0, 10, 0" FontSize="8pt" Text="{x:Static p:Resources.AddContact}"></TextBlock>
                                    </Grid>
                                </Button.Content>
                            </Button>-->
                        </StackPanel>
                    </Grid>
                </Border>
                <DataGrid x:Name="dgContacts" MaxHeight="0" VerticalAlignment="Stretch"
                      ItemsSource="{Binding CurrentContactLinkCollection, IsAsync=True, FallbackValue=...}"   
                  VirtualizingStackPanel.IsVirtualizing="True"
                  VirtualizingStackPanel.VirtualizationMode="Recycling"
                      Style="{StaticResource DataGridDemoStyle}"
                          ScrollViewer.PanningMode="Both"
                          AutoGenerateColumns="False"
                          EnableRowVirtualization="True"
                          EnableColumnVirtualization="False"
                          CanUserReorderColumns="False"
                      BeginningEdit="dg_BeginningEdit" MouseDoubleClick="dgContacts_MouseDoubleClick">
                    <DataGrid.Columns>
                        <DataGridTemplateColumn Header="Actions">
                            <DataGridTemplateColumn.CellTemplate>
                                <DataTemplate>
                                    <Controls:ContactLinkActionsRowControl x:Name="clarc" DataContext="{Binding}" 
                                                                           ShowUnlinkOption="True"
                                                                           EditLinkRequested="clarc_EditLinkRequested"
                                                                           UnlinkContactRequested="clarc_UnlinkContact"
                                                                     />
                                </DataTemplate>
                            </DataGridTemplateColumn.CellTemplate>
                        </DataGridTemplateColumn>

                        <DataGridTemplateColumn Header="">
                            <DataGridTemplateColumn.CellTemplate>
                                <DataTemplate>
                                    <StackPanel Orientation="Horizontal" Background="Transparent">
                                        <Path Width="12" 
                                          Height="12" 
                                          Stretch="Fill" 
                                          Visibility="{Binding ContactVM.IsLocked, Converter={StaticResource BooleanToVisibilityConverter}, FallbackValue=Collapsed}"
                                        Data="F1 M 22.17,36.4216L 25.3369,36.4216L 25.3369,31.6711C 25.3369,24.6745 31.0087,19.0027 38.0053,19.0027C 45.0019,19.0027 50.6737,24.6745 50.6737,31.6711L 50.6737,36.4216L 53.841,36.4216L 53.8411,57.008L 22.17,57.008L 22.17,36.4216 Z M 45.9231,31.6711C 45.9231,27.2982 42.3782,23.7533 38.0053,23.7533C 33.6324,23.7533 30.0875,27.2982 30.0875,31.6711L 30.0875,36.4216L 45.923,36.4216L 45.9231,31.6711 Z">
                                            <Path.Style>
                                                <Style TargetType="{x:Type Path}">
                                                    <Setter Property="Fill" Value="{StaticResource HighlightBrush}" />
                                                    <Style.Triggers>
                                                        <DataTrigger
                        Binding="{Binding
                            RelativeSource={RelativeSource
                                Mode=FindAncestor,
                                AncestorType={x:Type DataGridCell}},
                                Path=IsSelected}"
                        Value="True">
                                                            <Setter Property="Fill" Value="White"/>
                                                        </DataTrigger>
                                                    </Style.Triggers>
                                                </Style>
                                            </Path.Style>
                                        </Path>
                                    </StackPanel>
                                </DataTemplate>
                            </DataGridTemplateColumn.CellTemplate>
                        </DataGridTemplateColumn>

                        <DataGridTextColumn x:Name="contactIdColumn" Binding="{Binding ContactVM.ContactID}" IsReadOnly="True" Visibility="{Binding Data.ShowColumn, 
                            Converter={StaticResource BooleanToVisibilityConverter}, Source={StaticResource proxy}}">
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderContactID}" />
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn>
                        <DataGridTextColumn  Binding="{Binding ContactVM.ContactCDCID}" IsReadOnly="True"  Visibility="{Binding Data.IsCountryUS, 
                            Converter={StaticResource BooleanToVisibilityConverter}, Source={StaticResource proxy}}">
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderID}" />
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn>
                        <DataGridTextColumn Binding="{Binding ContactVM.ContactStateID}" IsReadOnly="True" Visibility="{Binding Data.IsCountryUS, 
                            Converter={StaticResource BooleanToVisibilityConverter}, Source={StaticResource proxy}}">
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderOriginalID}" />
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn>
                        <DataGridTextColumn Binding="{Binding ContactVM.Surname}" IsReadOnly="True" >
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderSurname}" />
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn>
                        <DataGridTextColumn Header="{x:Static p:Resources.ColHeaderOtherNames}" Binding="{Binding ContactVM.OtherNames}" IsReadOnly="True" >
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderOtherNames}" />
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn>
                        <DataGridTextColumn Header="{x:Static p:Resources.ColHeaderGender}" Binding="{Binding ContactVM.Gender}" IsReadOnly="True">
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderGender}" />
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn>
                        <DataGridTextColumn Header="{x:Static p:Resources.ColHeaderAge}" Binding="{Binding ContactVM.AgeYears}" IsReadOnly="True" >
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderAge}" />
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn>
                        <DataGridTextColumn Binding="{Binding ContactVM.HeadOfHousehold}" IsReadOnly="True" Visibility="{Binding Data.ShowColumn, 
                            Converter={StaticResource BooleanToVisibilityConverter}, Source={StaticResource proxy}}">
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock Text="{x:Static p:Resources.ColHeaderHeadHousehold}">
                                    </TextBlock>
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn>
                        <DataGridTextColumn Binding="{Binding ContactRiskLevel}" IsReadOnly="True" >
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderRiskLevel}" />
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn>
                        <!--<DataGridTextColumn Binding="{Binding ContactVillage}" IsReadOnly="True" >-->
                        <DataGridTextColumn Binding="{Binding ContactVM.Village}" IsReadOnly="True" >
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{Binding RelativeSource={RelativeSource
                                Mode=FindAncestor,
                                AncestorType={x:Type Window}},
                                Path=DataContext.Adm4}" />
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn>
                        <DataGridTextColumn Binding="{Binding ContactVM.Parish}" IsReadOnly="True"  Visibility="{Binding Data.ShowColumn, 
                            Converter={StaticResource BooleanToVisibilityConverter}, Source={StaticResource proxy}}">
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{Binding RelativeSource={RelativeSource
                                Mode=FindAncestor,
                                AncestorType={x:Type Window}},
                                Path=DataContext.Adm3}" />
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn>
                        <DataGridTextColumn Header="{x:Static p:Resources.ColHeaderSubCounty}" Binding="{Binding ContactVM.SubCounty}" IsReadOnly="True">
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <!--<TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderSubCounty}" />-->
                                    <TextBlock TextAlignment="Center" Text="{Binding RelativeSource={RelativeSource
                                Mode=FindAncestor,
                                AncestorType={x:Type Window}},
                                Path=DataContext.Adm2}" />
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn>
                        <DataGridTextColumn Binding="{Binding ContactVM.District}" IsReadOnly="True">
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <!--<TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderDistrict}" />-->
                                    <TextBlock TextAlignment="Center" Text="{Binding RelativeSource={RelativeSource
                                Mode=FindAncestor,
                                AncestorType={x:Type Window}},
                                Path=DataContext.Adm1}" />
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn>
                        <DataGridTextColumn Binding="{Binding ContactVM.Phone}" IsReadOnly="True">
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderPhone}" />
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn>
                        <DataGridTextColumn Binding="{Binding ContactVM.HCW}" IsReadOnly="True">
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderHCW}" />
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn>
                        <DataGridTextColumn Binding="{Binding ContactVM.HCWFacility}" IsReadOnly="True">
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderHealthCareFacility}" />
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn>
                        <DataGridTextColumn Binding="{Binding ContactVM.Team}" IsReadOnly="True" Visibility="{Binding Data.IsCountryUS, 
                            Converter={StaticResource BooleanToVisibilityConverter}, Source={StaticResource proxy}}">
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderTeam}" />
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn>
                        <DataGridTextColumn Binding="{Binding ContactVM.PublicHealthAction}" IsReadOnly="True" Visibility="{Binding Data.IsCountryUS, 
                            Converter={StaticResource BooleanToVisibilityConverter}, Source={StaticResource proxy}}">
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderPublicHealthAction}" />
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn>
                        <DataGridTextColumn Binding="{Binding ContactVM.FinalOutcome, Converter={StaticResource FinalOutcomeConverter}}" IsReadOnly="True">
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderFinalOutcome}" />
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn>
                        <!--Binding="{Binding DateLastContact, StringFormat='dd/MM/yyyy'}"-->
                        <DataGridTextColumn  IsReadOnly="True" SortMemberPath="DateLastContact">
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderDateLastContact}">
                                    </TextBlock>
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                            <DataGridTextColumn.Binding>
                                <MultiBinding Converter="{StaticResource DateConverter}" >
                                    <Binding Path="DataContext.DateLastContact" RelativeSource="{RelativeSource Self}"/>
                                    <Binding Path="DataContext.ApplicationCulture" RelativeSource="{RelativeSource  AncestorType={x:Type Window}}"/>
                                </MultiBinding>
                            </DataGridTextColumn.Binding>
                        </DataGridTextColumn>
                        <DataGridTextColumn Header="{x:Static p:Resources.ColHeaderContactType}" Binding="{Binding ContactTypeString}" IsReadOnly="True">
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderContactType}">
                                    </TextBlock>
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn>
                        <DataGridTextColumn Binding="{Binding Relationship}" IsReadOnly="True">
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderRelationshipContact}">
                                    </TextBlock>
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn>
                        <DataGridTextColumn Binding="{Binding ContactVM.Team}" IsReadOnly="True"  Visibility="{Binding Data.ShowColumn, 
                            Converter={StaticResource BooleanToVisibilityConverter}, Source={StaticResource proxy}}">
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock Text="{x:Static p:Resources.ColHeaderContactTracingTeam}" />
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn>
                    </DataGrid.Columns>
                </DataGrid>

                <Border x:Name="borderExposures" Visibility="Collapsed" Background="{StaticResource DataGridHeaderBackgroundBrush}">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition/>
                            <ColumnDefinition Width="Auto"/>
                        </Grid.ColumnDefinitions>

                        <!--<TextBlock Margin="5" FontWeight="SemiBold" FontSize="16" Foreground="White">Source Cases</TextBlock>-->

                        <StackPanel Orientation="Horizontal" Grid.Column="0">
                            <TextBlock Margin="5, 5, 15, 5" FontWeight="SemiBold" FontSize="16" Foreground="{StaticResource DataGridHeaderForegroundBrush}" Text="{x:Static p:Resources.SourceCases}"></TextBlock>

                            <TextBlock Margin="5, 5, 0, 5" FontWeight="SemiBold" FontSize="16" Foreground="{StaticResource DataGridHeaderForegroundBrush}">(</TextBlock>
                            <TextBlock Margin="0, 5, 0, 5" FontWeight="SemiBold" FontSize="16" Foreground="{StaticResource DataGridHeaderForegroundBrush}" Text="{Binding Path=CurrentSourceCaseCollection.Count}"></TextBlock>
                            <TextBlock Margin="0, 5, 5, 5" FontWeight="SemiBold" FontSize="16" Foreground="{StaticResource DataGridHeaderForegroundBrush}">)</TextBlock>
                        </StackPanel>

                        <StackPanel Margin="2" Orientation="Horizontal" Grid.Column="1">

                            <wpf:DarkOnLightCircleButton x:Name="btnAddExposure" Margin="1"
                                                         Click="btnAddExposure_Click"
                                                         IsEnabled="{Binding CaseCollectionView.CurrentPosition, Converter={StaticResource SelectedItemToEnabledConverter}}"
                                                         Text="{x:Static p:Resources.AddSourceCase}"
                                                         PathData="F1 M 35,19L 41,19L 41,35L 57,35L 57,41L 41,41L 41,57L 35,57L 35,41L 19,41L 19,35L 35,35L 35,19 Z "
                                                         />
                        </StackPanel>
                    </Grid>
                </Border>
                <DataGrid x:Name="dgExposures" MaxHeight="0"
                      ItemsSource="{Binding Path=CurrentSourceCaseCollection, IsAsync=True, FallbackValue=...}"                          
                  VirtualizingStackPanel.IsVirtualizing="True"
                  VirtualizingStackPanel.VirtualizationMode="Recycling"
                          AutoGenerateColumns="False"
                          CanUserReorderColumns="False"
                          ScrollViewer.PanningMode="Both"
                      Style="{StaticResource DataGridDemoStyle}" MouseDoubleClick="dgExposures_MouseDoubleClick">
                    <DataGrid.Columns>
                        <DataGridTemplateColumn Header="Actions">
                            <DataGridTemplateColumn.CellTemplate>
                                <DataTemplate>
                                    <Controls:CaseLinkActionsRowControl x:Name="caseLinkActions" DataContext="{Binding}" 
                                                                           EditLinkRequested="caseLinkActions_EditLinkRequested"
                                                                           UnlinkContactRequested="caseLinkActions_UnlinkContact"
                                                                     />
                                </DataTemplate>
                            </DataGridTemplateColumn.CellTemplate>
                        </DataGridTemplateColumn>
                        <DataGridTextColumn Header="{x:Static p:Resources.ColHeaderID}" Binding="{Binding ExposedCaseVM.ID}" IsReadOnly="True">
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderID}">
                                    </TextBlock>
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn>
                        <DataGridTextColumn Binding="{Binding ExposedCaseVM.OriginalID}" IsReadOnly="True" Visibility="{Binding Data.IsCountryUS, 
                            Converter={StaticResource BooleanToVisibilityConverter}, Source={StaticResource proxy}}">
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderOriginalID}" />
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn>
                        <DataGridTextColumn Header="{x:Static p:Resources.ColHeaderSurname}" Binding="{Binding ExposedCaseVM.Surname}" IsReadOnly="True">
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderSurname}">
                                    </TextBlock>
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn>
                        <DataGridTextColumn Header="{x:Static p:Resources.ColHeaderOtherNames}" Binding="{Binding ExposedCaseVM.OtherNames}" IsReadOnly="True">
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderOtherNames}">
                                    </TextBlock>
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn>
                        <DataGridTextColumn Binding="{Binding ExposedCaseVM.EpiCaseDef, ValidatesOnNotifyDataErrors=False, Converter={StaticResource EpiCaseClassificationConverter}}" IsReadOnly="True">
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderEpiCaseDef}">
                                    </TextBlock>
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn>
                        <!--<DataGridTextColumn Header="{x:Static p:Resources.ColHeaderRecStatus}" Binding="{Binding RecordStatus}" IsReadOnly="True"></DataGridTextColumn>-->
                        <DataGridTextColumn Header="{x:Static p:Resources.ColHeaderGender}" Binding="{Binding ExposedCaseVM.Gender, Converter={StaticResource GenderConverter}}" IsReadOnly="True" >
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderGender}">
                                    </TextBlock>
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn>
                        <DataGridTextColumn Header="{x:Static p:Resources.ColHeaderAge}" Binding="{Binding AgeYears}" IsReadOnly="True" >
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderAge}">
                                    </TextBlock>
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn> 
                        <!--Binding="{Binding DateOnset, StringFormat='dd/MM/yyyy'}"-->
                        <DataGridTextColumn Header="{x:Static p:Resources.ColHeaderOnsetDate}" IsReadOnly="True" SortMemberPath="DateOnset">
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderOnsetDate}">
                                    </TextBlock>
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                            <DataGridTextColumn.Binding>
                                <MultiBinding Converter="{StaticResource DateConverter}" >
                                    <Binding Path="DataContext.DateOnset" RelativeSource="{RelativeSource Self}"/>
                                    <Binding Path="DataContext.ApplicationCulture" RelativeSource="{RelativeSource  AncestorType={x:Type Window}}"/>
                                </MultiBinding>
                            </DataGridTextColumn.Binding>
                        </DataGridTextColumn>

                        <DataGridTextColumn Binding="{Binding CurrentStatus}" IsReadOnly="True">
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderCurrentStatus}">
                                    </TextBlock>
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn>
                        <!--Binding="{Binding DateDeath, StringFormat='dd/MM/yyyy'}"-->
                        <DataGridTextColumn Header="{x:Static p:Resources.ColHeaderDeathDate}"  IsReadOnly="True" SortMemberPath="DateDeath">
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderDeathDate}">
                                    </TextBlock>
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                            <DataGridTextColumn.Binding>
                                <MultiBinding Converter="{StaticResource DateConverter}" >
                                    <Binding Path="DataContext.DateDeath" RelativeSource="{RelativeSource Self}"/>
                                    <Binding Path="DataContext.ApplicationCulture" RelativeSource="{RelativeSource  AncestorType={x:Type Window}}"/>
                                </MultiBinding>
                            </DataGridTextColumn.Binding>
                        </DataGridTextColumn>
                        <DataGridTextColumn Binding="{Binding ExposedCaseVM.IsHCW, Converter={StaticResource HCWConverter}}" IsReadOnly="True" >
                            <!--17179-->
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderIsHCW}" />
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn>
                        <DataGridTextColumn Header="{x:Static p:Resources.ColHeaderVillage}" Binding="{Binding ExposedCaseVM.Village}" IsReadOnly="True" >
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{Binding RelativeSource={RelativeSource
                                Mode=FindAncestor,
                                AncestorType={x:Type Window}},
                                Path=DataContext.Adm4}" />
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn>
                        <DataGridTextColumn Header="{x:Static p:Resources.ColHeaderParish}" Binding="{Binding ExposedCaseVM.Parish}" IsReadOnly="True"  Visibility="{Binding Data.ShowColumn, 
                            Converter={StaticResource BooleanToVisibilityConverter}, Source={StaticResource proxy}}">
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{Binding RelativeSource={RelativeSource
                                Mode=FindAncestor,
                                AncestorType={x:Type Window}},
                                Path=DataContext.Adm3}" />
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn>
                        <DataGridTextColumn Header="{x:Static p:Resources.ColHeaderSubCounty}" Binding="{Binding ExposedCaseVM.SubCounty}" IsReadOnly="True">
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <!--<TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderSubCounty}" />-->
                                    <TextBlock TextAlignment="Center" Text="{Binding RelativeSource={RelativeSource
                                Mode=FindAncestor,
                                AncestorType={x:Type Window}},
                                Path=DataContext.Adm2}" />
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn>
                        <DataGridTextColumn Binding="{Binding ExposedCaseVM.District}" IsReadOnly="True" >
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <!--<TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderDistrict}" />-->
                                    <TextBlock TextAlignment="Center" Text="{Binding RelativeSource={RelativeSource
                                Mode=FindAncestor,
                                AncestorType={x:Type Window}},
                                Path=DataContext.Adm1}" />
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn>
                        <DataGridTextColumn Binding="{Binding ExposedCaseVM.Country}" IsReadOnly="True">
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderCountry}" />
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn>
                        <DataGridTextColumn Binding="{Binding ExposedCaseVM.DistrictOnset}" IsReadOnly="True">
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <!--<TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderDistrictOnset}" />-->
                                    <TextBlock TextAlignment="Center" Text="{Binding RelativeSource={RelativeSource
                                Mode=FindAncestor,
                                AncestorType={x:Type Window}},
                                Path=DataContext.Adm1Onset}" />
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn>
                        <DataGridTextColumn Binding="{Binding ExposedCaseVM.CountryOnset}" IsReadOnly="True">
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderCountryOnset}" />
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn>
                        <DataGridTextColumn Binding="{Binding ExposedCaseVM.Citizenship}" IsReadOnly="True" Visibility="{Binding Data.IsCountryUS, 
                            Converter={StaticResource BooleanToVisibilityConverter}, Source={StaticResource proxy}}">
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderCitizenship}" />
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn>
                        <!--Binding="{Binding DateIsolationCurrent, StringFormat='dd/MM/yyyy'}"-->
                        <DataGridTextColumn  IsReadOnly="True" SortMemberPath="DateIsolationCurrent">
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderDateIso}">
                                    </TextBlock>
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                            <DataGridTextColumn.Binding>
                                <MultiBinding Converter="{StaticResource DateConverter}" >
                                    <Binding Path="DataContext.DateIsolationCurrent" RelativeSource="{RelativeSource Self}"/>
                                    <Binding Path="DataContext.ApplicationCulture" RelativeSource="{RelativeSource  AncestorType={x:Type Window}}"/>
                                </MultiBinding>
                            </DataGridTextColumn.Binding>
                        </DataGridTextColumn>
                        <!--Binding="{Binding DateDischargeIso, StringFormat='dd/MM/yyyy'}"-->
                        <DataGridTextColumn  IsReadOnly="True" SortMemberPath="DateDischargeIso">
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderDateDischargeIso}">
                                    </TextBlock>
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                            <DataGridTextColumn.Binding>
                                <MultiBinding Converter="{StaticResource DateConverter}" >
                                    <Binding Path="DataContext.DateDischargeIso" RelativeSource="{RelativeSource Self}"/>
                                    <Binding Path="DataContext.ApplicationCulture" RelativeSource="{RelativeSource  AncestorType={x:Type Window}}"/>
                                </MultiBinding>
                            </DataGridTextColumn.Binding>
                        </DataGridTextColumn>
                        <DataGridTextColumn Binding="{Binding ExposedCaseVM.FinalLabClass, Converter={StaticResource FinalLabClassificationConverter}}" IsReadOnly="True">
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderFinalLabClass}">
                                    </TextBlock>
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn>
                        <!--<DataGridTextColumn Header="Isolation current?" Binding="{Binding IsolationCurrent}" IsReadOnly="True"></DataGridTextColumn>-->
                        <!--Binding="{Binding DateLastContact, StringFormat='dd/MM/yyyy'}"-->
                        <DataGridTextColumn IsReadOnly="True" SortMemberPath="DateLastContact">
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderDateLastContact}">
                                    </TextBlock>
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                            <DataGridTextColumn.Binding>
                                <MultiBinding Converter="{StaticResource DateConverter}" >
                                    <Binding Path="DataContext.DateLastContact" RelativeSource="{RelativeSource Self}"/>
                                    <Binding Path="DataContext.ApplicationCulture" RelativeSource="{RelativeSource  AncestorType={x:Type Window}}"/>
                                </MultiBinding>
                            </DataGridTextColumn.Binding>
                        </DataGridTextColumn>
                        <DataGridTextColumn Binding="{Binding ContactTypeString}" IsReadOnly="True">
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderContactType}">
                                    </TextBlock>
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn>
                        <DataGridTextColumn Binding="{Binding Relationship}" IsReadOnly="True">
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderRelationshipSourceCase}">
                                    </TextBlock>
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn>
                    </DataGrid.Columns>
                </DataGrid>
            </StackPanel>
        </Grid>

        <Grid x:Name="gridContacts"  Visibility="{Binding IsChecked, ElementName=tabButtonContacts, Converter={StaticResource BooleanToVisibilityConverter}}" VerticalAlignment="Stretch" Background="{StaticResource mainPanelBackgroundBrush}" Grid.Row="3">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>

            <StackPanel x:Name="panelContactManagementSearch" Grid.Row="0" Margin="10,5,0,5">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition />
                        <ColumnDefinition Width="Auto" />
                    </Grid.ColumnDefinitions>

                    <StackPanel Orientation="Horizontal" Grid.Column="0">
                        <Controls:SubTabButton x:Name="subTabAllContacts" IsChecked="True" Content="{x:Static p:Resources.SubTabAllContacts}" Margin="0,0,10,0" Click="subTabAllContacts_MouseLeftButtonUp"></Controls:SubTabButton>
                        <TextBlock Grid.Row="0" FontWeight="Light" Foreground="#585858" FontSize="24" Margin="0,0,10,0">|</TextBlock>
                        <Controls:SubTabButton x:Name="subTabDailyContacts" IsChecked="False" Content="{x:Static p:Resources.SubTabDailyFollowUps}" Margin="0,0,10,0" Click="subTabDailyContacts_MouseLeftButtonUp"></Controls:SubTabButton>
                        <TextBlock Grid.Row="0" FontWeight="Light" Foreground="#585858" FontSize="24" Margin="0,0,10,0">|</TextBlock>
                        <Controls:SubTabButton x:Name="subTabPrevContacts" IsChecked="False" Content="{x:Static p:Resources.SubTabPriorFollowUps}" Click="subTabPrevContacts_MouseLeftButtonUp"></Controls:SubTabButton>
                    </StackPanel>
                    <!--<Image Grid.Column="1" Width="20" Height="20" Margin="20,0,20,0" Source="Images\word.png" Cursor="Hand" MouseDown="contactFormPrint_Click"/>-->
                    <Button Click="contactFormPrint_Click" 
                            Visibility="{Binding Data.ShowColumn, Converter={StaticResource BooleanToVisibilityConverter}, Source={StaticResource proxy}}"
                            Margin="10,0,10,0" 
                            HorizontalAlignment="Right" 
                            BorderThickness="0"
                            Style="{StaticResource ResourceKey=BacklessButtonStyle}">
                        <Button.Content>
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto" />
                                    <ColumnDefinition Width="Auto" />
                                </Grid.ColumnDefinitions>
                                <Path Grid.Column="1" Width="20" Height="25" Margin="6, 2, 0, 2" Stretch="Fill" Fill="Black" Data="F1 M 52,34L 39,34L 39,21L 24,21L 24,55L 52,55L 52,34 Z M 55.9999,59L 20,59L 20,17L 43.25,17L 55.9999,29.75L 55.9999,59 Z M 43,22.25L 43,30L 50.7499,30L 43,22.25 Z M 31,53L 31,45L 34,45C 35.6569,45 37,45.8431 37,47.5C 37,49.1569 35.6569,50 34,50L 33,50L 33,53L 31,53 Z M 34,48C 34.5523,48 35,48.0523 35,47.5C 35,46.9477 34.5523,47 34,47L 33,47L 33,48L 34,48 Z M 45,53L 45,45L 50,45L 50,47L 47,47L 47,48L 49,48L 49,50L 47,50L 47,53L 45,53 Z M 38,45L 41,45C 42.6569,45 44,46.3431 44,48L 44,50C 44,51.6568 42.6569,53 41,53L 38,53L 38,45 Z M 42,50L 42,48C 42,47.4477 41.5523,47 41,47L 40,47L 40,51L 41,51C 41.5523,51 42,50.5523 42,50 Z "/>
                                <!--<Path HorizontalAlignment="Center" Grid.Row="0" Margin="6, 2, 6, 2" Width="12" Height="12" Stretch="Fill" Fill="{StaticResource RoundedButtonShapeForegroundBrush}" Data="F1 M 25,27L 25,17L 51,17L 51,27L 47,27L 47,21L 29,21L 29,27L 25,27 Z M 16,28L 60,28L 60,51L 52,51L 52,46L 55,46L 55,33L 21,33L 21,46L 24,46L 24,51L 16,51L 16,28 Z M 25,39L 28,39L 28,52L 35,52L 35,59L 48,59L 48,39L 51,39L 51,62L 33,62L 25,54L 25,39 Z M 46,55L 38,55L 38,52L 46,52L 46,55 Z M 46,49L 30,49L 30,46L 46,46L 46,49 Z M 46,43L 30,43L 30,40L 46,40L 46,43 Z "/>-->
                                <!--<Path HorizontalAlignment="Center" Grid.Row="0" Margin="6, 2, 6, 2" Width="24" Height="24" Stretch="Fill" Fill="{StaticResource RoundedButtonShapeForegroundBrush}" Data="F1 M 38,0.791664C 58.5496,0.791664 75.2083,17.4504 75.2083,38C 75.2083,58.5496 58.5496,75.2083 38,75.2083C 17.4504,75.2083 0.791662,58.5496 0.791662,38C 0.791662,17.4504 17.4504,0.791664 38,0.791664 Z M 38,5.54166C 20.0738,5.54166 5.54167,20.0738 5.54167,38C 5.54167,55.9262 20.0738,70.4583 38,70.4583C 55.9262,70.4583 70.4583,55.9262 70.4583,38C 70.4583,20.0738 55.9262,5.54166 38,5.54166 Z "/>-->

                                <TextBlock VerticalAlignment="Center"  HorizontalAlignment="Center" Grid.Column="0" Margin="0, 0, 0, 0" FontSize="8pt" Text="{x:Static p:Resources.PrintContactListForm}" />
                            </Grid>
                        </Button.Content>
                    </Button>
                </Grid>

                <DockPanel Height="8" />

                <!--<StackPanel x:Name="panelAllContactsButtons" Height="32" Orientation="Horizontal">
                    <Button x:Name="btnCollapseAll" Width="150" Margin="3" Click="btnCollapseAll_Click" Content="{x:Static p:Resources.ShowContactsOnly}" />
                    <Button x:Name="btnExpandCases" Width="150" Margin="3" Click="btnExpandCases_Click" Content="{x:Static p:Resources.ShowSourceCases}" />
                    <Button x:Name="btnExpandChart" Width="150" Margin="3" Click="btnExpandChart_Click" Content="{x:Static p:Resources.ShowIndividualReport}" />

                </StackPanel>-->

                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="*" />
                    </Grid.ColumnDefinitions>
                    <Controls:SearchBox Margin="0, 0, 10, 0" x:Name="contactsSearchBox" Grid.Column="1" SearchText="{Binding SearchContactsText,UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}" Search="{Binding SearchContacts}" Visibility="{Binding ElementName=panelAllContacts, Path=Visibility}" HorizontalAlignment="Right" />
                    <StackPanel Grid.Column="0" Height="Auto" Orientation="Horizontal" x:Name="panelAllContactsButtons">
                        <!--<TextBlock VerticalAlignment="Center" FontSize="8pt" Foreground="Black" Margin="20, 0, 6, 0">Show:</TextBlock>
                        <Button Style="{StaticResource BacklessButtonStyle}" FontSize="8pt" x:Name="btnCollapseAll" Margin="3, 0, 3, 0" Click="btnCollapseAll_Click" Content="{x:Static p:Resources.ShowContactsOnly}" />
                        <TextBlock VerticalAlignment="Center" FontSize="8pt" Foreground="Black" Margin="6, 0, 6, 0">|</TextBlock>
                        <Button Style="{StaticResource BacklessButtonStyle}" FontSize="8pt" x:Name="btnExpandCases" Margin="3, 0, 3, 0" Click="btnExpandCases_Click" Content="{x:Static p:Resources.ShowSourceCases}" />
                        <TextBlock VerticalAlignment="Center" FontSize="8pt" Foreground="Black" Margin="6, 0, 6, 0">|</TextBlock>
                        <Button Style="{StaticResource BacklessButtonStyle}" FontSize="8pt" x:Name="btnExpandChart" Margin="3, 0, 3, 0" Click="btnExpandChart_Click" Content="{x:Static p:Resources.ShowIndividualReport}" />-->

                        <ToggleButton Style="{StaticResource FlatToggleButtonStyle}" 
                                          IsChecked="False"
                                          x:Name="btnCollapseAll" MinWidth="120" Margin="3" 
                                          Click="btnCollapseAll_Click" 
                                          Content="{x:Static p:Resources.ShowContactsOnly}" />
                        <ToggleButton Style="{StaticResource FlatToggleButtonStyle}" 
                                          IsChecked="True"
                                          x:Name="btnExpandCases" MinWidth="120" Margin="3" 
                                          Click="btnExpandCases_Click" 
                                          Content="{x:Static p:Resources.ShowSourceCases}" />
                        <ToggleButton Style="{StaticResource FlatToggleButtonStyle}" 
                                          IsChecked="False"
                                          x:Name="btnExpandChart" MinWidth="120" Margin="3" 
                                          Click="btnExpandChart_Click" 
                                          Content="{x:Static p:Resources.ShowIndividualReport}" />
                    </StackPanel>
                </Grid>
            </StackPanel>

            <StackPanel Grid.Row="1" x:Name="panelPrevContacts" Visibility="Collapsed" Margin="10,5,10,10">
                <StackPanel>
                    <Border Background="{StaticResource DataGridHeaderBackgroundBrush}" x:Name="borderPrevContacts">
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto" MinWidth="250" />
                                <ColumnDefinition Width="*" />
                                <ColumnDefinition Width="Auto" />
                            </Grid.ColumnDefinitions>
                            <StackPanel Orientation="Horizontal" VerticalAlignment="Bottom">

                                <TextBlock Margin="5, 5, 15, 5" FontWeight="SemiBold" FontSize="16" Foreground="{StaticResource DataGridHeaderForegroundBrush}" Text="{x:Static p:Resources.PriorFollowUps}" />

                                <TextBlock Margin="5, 5, 0, 5" FontWeight="SemiBold" FontSize="16" Foreground="{StaticResource DataGridHeaderForegroundBrush}">(</TextBlock>
                                <TextBlock Margin="0, 5, 0, 5" FontWeight="SemiBold" FontSize="16" Foreground="{StaticResource DataGridHeaderForegroundBrush}" Text="{Binding Path=PrevFollowUpCollection.Count}"></TextBlock>
                                <TextBlock Margin="0, 5, 5, 5" FontWeight="SemiBold" FontSize="16" Foreground="{StaticResource DataGridHeaderForegroundBrush}">)</TextBlock>

                                <TextBlock Margin="5, 5, 5, 5" x:Name="tblockPrevDate" FontWeight="SemiBold" FontSize="16" Foreground="{StaticResource DataGridHeaderForegroundBrush}"></TextBlock>
                            </StackPanel>


                            <StackPanel HorizontalAlignment="Left" Grid.Column="1" Margin="2, 0, 2, 4">
                                <wpf:ContactTracingLegend />
                            </StackPanel>

                            <StackPanel Margin="2" Orientation="Horizontal" Grid.Column="2" VerticalAlignment="Bottom">
                                <!--<Button x:Name="btnPrintDailyReportPrev" Margin="1" Width="135" Height="18" Style="{StaticResource FlatButtonStyle}" Click="btnPrintDailyFollowUpPrev_Click">
                                    <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Text="{x:Static p:Resources.PrintDailyReport}" />
                                </Button>-->

                                <wpf:DarkOnLightCircleButton x:Name="btnPrintDailyReportPrev" Margin="1"
                                                         Click="btnPrintDailyFollowUpPrev_Click"
                                                         Text="{x:Static p:Resources.PrintDailyReport}"
                                                         Tag="panelPrevContacts"
                                                         PathData="F1 M 25,27L 25,17L 51,17L 51,27L 47,27L 47,21L 29,21L 29,27L 25,27 Z M 16,28L 60,28L 60,51L 52,51L 52,46L 55,46L 55,33L 21,33L 21,46L 24,46L 24,51L 16,51L 16,28 Z M 25,39L 28,39L 28,52L 35,52L 35,59L 48,59L 48,39L 51,39L 51,62L 33,62L 25,54L 25,39 Z M 46,55L 38,55L 38,52L 46,52L 46,55 Z M 46,49L 30,49L 30,46L 46,46L 46,49 Z M 46,43L 30,43L 30,40L 46,40L 46,43 Z "
                                                         >
                                    <!--<wpf:DarkOnLightCircleButton.ContextMenu>
                                        <ContextMenu>
                                            <MenuItem Header="{Binding Adm1}" Click="btnPrintDailyFollowUpPrevByDistrict_Click"></MenuItem>
                                            <MenuItem Header="{Binding Adm2}" Click="btnPrintDailyFollowUpPrevBySC_Click"></MenuItem>
                                            <MenuItem Header="{Binding Adm4}" Click="btnPrintDailyFollowUpPrevByVillage_Click"></MenuItem>
                                        </ContextMenu>
                                    </wpf:DarkOnLightCircleButton.ContextMenu>-->
                                </wpf:DarkOnLightCircleButton>

                                <!--<Button x:Name="btnPrintDailyReportPrev" Margin="1" Style="{StaticResource RoundedButtonStyle}" Click="btnPrintDailyFollowUpPrev_Click">
                                    <Button.Content>
                                        <Grid>
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="Auto" />
                                                <ColumnDefinition Width="Auto" />
                                            </Grid.ColumnDefinitions>
                                            <Path HorizontalAlignment="Center" Grid.Row="0" Margin="6, 2, 6, 2" Width="12" Height="12" Stretch="Fill" Fill="{StaticResource RoundedButtonShapeForegroundBrush}" Data="F1 M 25,27L 25,17L 51,17L 51,27L 47,27L 47,21L 29,21L 29,27L 25,27 Z M 16,28L 60,28L 60,51L 52,51L 52,46L 55,46L 55,33L 21,33L 21,46L 24,46L 24,51L 16,51L 16,28 Z M 25,39L 28,39L 28,52L 35,52L 35,59L 48,59L 48,39L 51,39L 51,62L 33,62L 25,54L 25,39 Z M 46,55L 38,55L 38,52L 46,52L 46,55 Z M 46,49L 30,49L 30,46L 46,46L 46,49 Z M 46,43L 30,43L 30,40L 46,40L 46,43 Z "/>
                                            <Path HorizontalAlignment="Center" Grid.Row="0" Margin="6, 2, 6, 2" Width="24" Height="24" Stretch="Fill" Fill="{StaticResource RoundedButtonShapeForegroundBrush}" Data="F1 M 38,0.791664C 58.5496,0.791664 75.2083,17.4504 75.2083,38C 75.2083,58.5496 58.5496,75.2083 38,75.2083C 17.4504,75.2083 0.791662,58.5496 0.791662,38C 0.791662,17.4504 17.4504,0.791664 38,0.791664 Z M 38,5.54166C 20.0738,5.54166 5.54167,20.0738 5.54167,38C 5.54167,55.9262 20.0738,70.4583 38,70.4583C 55.9262,70.4583 70.4583,55.9262 70.4583,38C 70.4583,20.0738 55.9262,5.54166 38,5.54166 Z "/>

                                            <TextBlock VerticalAlignment="Center"  HorizontalAlignment="Center" Grid.Column="1" Margin="0, 0, 10, 0" FontSize="8pt" Text="{x:Static p:Resources.PrintDailyReport}"></TextBlock>
                                        </Grid>
                                    </Button.Content>
                                </Button>-->

                                <DatePicker x:Name="dpPrev" SelectedDateChanged="dpPrev_SelectedDateChanged" />
                            </StackPanel>
                        </Grid>
                    </Border>

                    <DataGrid x:Name="dgPrev" MaxHeight="600" VerticalAlignment="Stretch"
                      ItemsSource="{Binding Path=PrevFollowUpCollection, IsAsync=True, FallbackValue=...}"                          
                  VirtualizingStackPanel.IsVirtualizing="True"
                  VirtualizingStackPanel.VirtualizationMode="Standard"
                      Style="{StaticResource DataGridDemoStyle}"
                              CanUserReorderColumns="False"
                              ScrollViewer.PanningMode="Both"
                              MouseDoubleClick="dgPrev_MouseDoubleClick"
                              AutoGenerateColumns="False">
                        <DataGrid.Columns>

                            <DataGridTemplateColumn Header="">
                                <DataGridTemplateColumn.CellTemplate>
                                    <DataTemplate>
                                        <Path Width="12" 
                                          Height="12" 
                                          Stretch="Fill" 
                                          Visibility="{Binding ContactVM.IsLocked, Converter={StaticResource BooleanToVisibilityConverter}, FallbackValue=Collapsed}"
                                        Data="F1 M 22.17,36.4216L 25.3369,36.4216L 25.3369,31.6711C 25.3369,24.6745 31.0087,19.0027 38.0053,19.0027C 45.0019,19.0027 50.6737,24.6745 50.6737,31.6711L 50.6737,36.4216L 53.841,36.4216L 53.8411,57.008L 22.17,57.008L 22.17,36.4216 Z M 45.9231,31.6711C 45.9231,27.2982 42.3782,23.7533 38.0053,23.7533C 33.6324,23.7533 30.0875,27.2982 30.0875,31.6711L 30.0875,36.4216L 45.923,36.4216L 45.9231,31.6711 Z">
                                            <Path.Style>
                                                <Style TargetType="{x:Type Path}">
                                                    <Setter Property="Fill" Value="{StaticResource HighlightBrush}" />
                                                    <Style.Triggers>
                                                        <DataTrigger
                        Binding="{Binding
                            RelativeSource={RelativeSource
                                Mode=FindAncestor,
                                AncestorType={x:Type DataGridCell}},
                                Path=IsSelected}"
                        Value="True">
                                                            <Setter Property="Fill" Value="White"/>
                                                        </DataTrigger>
                                                    </Style.Triggers>
                                                </Style>
                                            </Path.Style>
                                        </Path>
                                    </DataTemplate>
                                </DataGridTemplateColumn.CellTemplate>
                            </DataGridTemplateColumn>

                            <DataGridTextColumn Header="{x:Static p:Resources.ColHeaderContactID}" Binding="{Binding ContactID}" IsReadOnly="True" Visibility="{Binding Data.ShowColumn, 
                            Converter={StaticResource BooleanToVisibilityConverter}, Source={StaticResource proxy}}" />
                            <DataGridTextColumn  Binding="{Binding ContactVM.ContactCDCID}" IsReadOnly="True"  Visibility="{Binding Data.IsCountryUS, 
                            Converter={StaticResource BooleanToVisibilityConverter}, Source={StaticResource proxy}}" Header="{x:Static p:Resources.ColHeaderID}" />
                            <DataGridTextColumn  Binding="{Binding ContactVM.ContactStateID}" IsReadOnly="True"  Visibility="{Binding Data.IsCountryUS, 
                            Converter={StaticResource BooleanToVisibilityConverter}, Source={StaticResource proxy}}" Header="{x:Static p:Resources.ColHeaderOriginalID}"/>
                            <DataGridTextColumn Header="{x:Static p:Resources.ColHeaderSurname}" Binding="{Binding ContactVM.Surname}" IsReadOnly="True"></DataGridTextColumn>
                            <DataGridTextColumn Header="{x:Static p:Resources.ColHeaderOtherNames}" Binding="{Binding ContactVM.OtherNames}" IsReadOnly="True"></DataGridTextColumn>
                            <DataGridTextColumn Header="{x:Static p:Resources.ColHeaderAge}" Binding="{Binding ContactVM.AgeYears}" IsReadOnly="True"></DataGridTextColumn>
                            <DataGridTextColumn Header="{x:Static p:Resources.ColHeaderGender}" Binding="{Binding ContactVM.Gender}" IsReadOnly="True"></DataGridTextColumn>
                            <DataGridTextColumn Header="{x:Static p:Resources.Adm4Default}" Binding="{Binding ContactVM.Village}" IsReadOnly="True">
                                <DataGridTextColumn.HeaderTemplate>
                                    <DataTemplate>
                                        <TextBlock TextAlignment="Center" Text="{Binding RelativeSource={RelativeSource
                                Mode=FindAncestor,
                                AncestorType={x:Type Window}},
                                Path=DataContext.Adm4}" />
                                    </DataTemplate>
                                </DataGridTextColumn.HeaderTemplate>
                            </DataGridTextColumn>

                            <DataGridTextColumn Header="{x:Static p:Resources.Adm3Default}" Binding="{Binding ContactVM.Parish}" IsReadOnly="True"  Visibility="{Binding Data.ShowColumn, 
                            Converter={StaticResource BooleanToVisibilityConverter}, Source={StaticResource proxy}}">
                                <DataGridTextColumn.HeaderTemplate>
                                    <DataTemplate>
                                        <TextBlock TextAlignment="Center" Text="{Binding RelativeSource={RelativeSource
                                Mode=FindAncestor,
                                AncestorType={x:Type Window}},
                                Path=DataContext.Adm3}" />
                                    </DataTemplate>
                                </DataGridTextColumn.HeaderTemplate>
                            </DataGridTextColumn>
                            <DataGridTextColumn Header="{x:Static p:Resources.Adm2Default}" Binding="{Binding ContactVM.SubCounty}" IsReadOnly="True">
                                <DataGridTextColumn.HeaderTemplate>
                                    <DataTemplate>
                                        <TextBlock TextAlignment="Center" Text="{Binding RelativeSource={RelativeSource
                                Mode=FindAncestor,
                                AncestorType={x:Type Window}},
                                Path=DataContext.Adm2}" />
                                    </DataTemplate>
                                </DataGridTextColumn.HeaderTemplate>
                            </DataGridTextColumn>
                            <DataGridTextColumn Header="{x:Static p:Resources.Adm1Default}" Binding="{Binding ContactVM.District}" IsReadOnly="True">
                                <DataGridTextColumn.HeaderTemplate>
                                    <DataTemplate>
                                        <TextBlock TextAlignment="Center" Text="{Binding RelativeSource={RelativeSource
                                Mode=FindAncestor,
                                AncestorType={x:Type Window}},
                                Path=DataContext.Adm1}" />
                                    </DataTemplate>
                                </DataGridTextColumn.HeaderTemplate>
                            </DataGridTextColumn>

                            <!--<DataGridTextColumn Header="Day" Binding="{Binding Day}" IsReadOnly="True"></DataGridTextColumn>--> 
                            <!--Binding="{Binding DateLastContact, StringFormat='dd/MM/yyyy'}"-->
                            <DataGridTextColumn IsReadOnly="True" SortMemberPath="DateLastContact">
                                <DataGridTextColumn.HeaderTemplate>
                                    <DataTemplate>
                                        <TextBlock Text="{x:Static p:Resources.ColHeaderDateLastContact}" />
                                    </DataTemplate>
                                </DataGridTextColumn.HeaderTemplate>
                                <DataGridTextColumn.Binding>
                                    <MultiBinding Converter="{StaticResource DateConverter}" >
                                        <Binding Path="DataContext.DateLastContact" RelativeSource="{RelativeSource Self}"/>
                                        <Binding Path="DataContext.ApplicationCulture" RelativeSource="{RelativeSource  AncestorType={x:Type Window}}"/>
                                    </MultiBinding>
                                </DataGridTextColumn.Binding>
                            </DataGridTextColumn> 
                            <!--Binding="{Binding MonitorTo, StringFormat='dd/MM/yyyy'}"-->
                            <DataGridTextColumn IsReadOnly="True" SortMemberPath="MonitorTo">
                                <DataGridTextColumn.HeaderTemplate>
                                    <DataTemplate>
                                        <TextBlock Text="{x:Static p:Resources.ColHeaderDateLastFollowUp}" />
                                    </DataTemplate>
                                </DataGridTextColumn.HeaderTemplate>
                                <DataGridTextColumn.Binding>
                                    <MultiBinding Converter="{StaticResource DateConverter}" >
                                        <Binding Path="DataContext.MonitorTo" RelativeSource="{RelativeSource Self}"/>
                                        <Binding Path="DataContext.ApplicationCulture" RelativeSource="{RelativeSource  AncestorType={x:Type Window}}"/>
                                    </MultiBinding>
                                </DataGridTextColumn.Binding>
                            </DataGridTextColumn>
                            <DataGridTextColumn Header="{x:Static p:Resources.ColHeaderTeam}" Binding="{Binding ContactVM.Team}" IsReadOnly="True"></DataGridTextColumn>
                            <DataGridTextColumn Binding="{Binding ContactVM.LastSourceCase.ID}" IsReadOnly="True">
                                <DataGridTextColumn.HeaderTemplate>
                                    <DataTemplate>
                                        <TextBlock Text="{x:Static p:Resources.ColHeaderSourceCaseID}" />
                                    </DataTemplate>
                                </DataGridTextColumn.HeaderTemplate>
                            </DataGridTextColumn>
                            <DataGridTextColumn Binding="{Binding ContactVM.LastSourceCase.Surname}" IsReadOnly="True">
                                <DataGridTextColumn.HeaderTemplate>
                                    <DataTemplate>
                                        <TextBlock Text="{x:Static p:Resources.ColHeaderSourceCaseSurname}" />
                                    </DataTemplate>
                                </DataGridTextColumn.HeaderTemplate>
                            </DataGridTextColumn>
                            <DataGridTextColumn Binding="{Binding ContactVM.LastSourceCase.OtherNames}" IsReadOnly="True">
                                <DataGridTextColumn.HeaderTemplate>
                                    <DataTemplate>
                                        <TextBlock Text="{x:Static p:Resources.ColHeaderSourceCaseOtherNames}" />
                                    </DataTemplate>
                                </DataGridTextColumn.HeaderTemplate>
                            </DataGridTextColumn>

                            <DataGridTemplateColumn Header="{x:Static p:Resources.ColHeaderStatus}">
                                <DataGridTemplateColumn.CellTemplate>
                                    <DataTemplate>
                                        <Controls:StatusSelector IsEnabled="{Binding ContactVM.IsLocked, Converter={StaticResource BooleanInverter}, FallbackValue=True}" DataContext="{Binding}" StatusChanged="statusControl_StatusChanged" />
                                    </DataTemplate>
                                </DataGridTemplateColumn.CellTemplate>
                            </DataGridTemplateColumn>

                            <!--<DataGridTemplateColumn Header="Seen?" IsReadOnly="True">
                                <DataGridTemplateColumn.CellTemplate>
                                    <DataTemplate>
                                        <ComboBox x:Name="cmbFollowUpSeen" IsReadOnly="True"
                                            SelectedItem="{Binding Seen}" ItemsSource="{Binding Source={StaticResource SeenTypeValues}}" SelectionChanged="cmbPrevFollowUpSeen_SelectionChanged" >
                                            <ComboBox.ItemTemplate>
                                                <DataTemplate>
                                                    <TextBlock Text="{Binding Converter={StaticResource EnumDescriptionConverter}}"/>
                                                </DataTemplate>
                                            </ComboBox.ItemTemplate>
                                        </ComboBox>
                                    </DataTemplate>
                                </DataGridTemplateColumn.CellTemplate>
                            </DataGridTemplateColumn>

                            <DataGridTemplateColumn Header="Sick?" IsReadOnly="True">
                                <DataGridTemplateColumn.CellTemplate>
                                    <DataTemplate>
                                        <ComboBox x:Name="cmbFollowUpSickness" IsReadOnly="True"
                                            SelectedItem="{Binding Sickness}" ItemsSource="{Binding Source={StaticResource SicknessTypeValues}}" SelectionChanged="cmbPrevFollowUpSickness_SelectionChanged" PreviewMouseWheel="cmbFollowUpSickness_PreviewMouseWheel">
                                            <ComboBox.ItemTemplate>
                                                <DataTemplate>
                                                    <TextBlock Text="{Binding Converter={StaticResource EnumDescriptionConverter}}"/>
                                                </DataTemplate>
                                            </ComboBox.ItemTemplate>
                                        </ComboBox>
                                    </DataTemplate>
                                </DataGridTemplateColumn.CellTemplate>
                            </DataGridTemplateColumn>-->

                            <DataGridTemplateColumn Header="Temperature 1">
                                <DataGridTemplateColumn.CellStyle>
                                    <Style TargetType="{x:Type DataGridCell}">
                                        <Setter Property="IsTabStop" Value="False" />
                                        <Setter Property="Focusable" Value="False" />
                                    </Style>
                                </DataGridTemplateColumn.CellStyle>
                                <DataGridTemplateColumn.CellTemplate>
                                    <DataTemplate>
                                        <TextBox x:Name="txtTemp1" IsEnabled="{Binding ContactVM.IsLocked, Converter={StaticResource BooleanInverter}, FallbackValue=True}" Text="{Binding Temp1, Mode=TwoWay, StringFormat=N1}" LostFocus="txtPrevTemp1_LostFocus" />
                                    </DataTemplate>
                                </DataGridTemplateColumn.CellTemplate>
                            </DataGridTemplateColumn>

                            <DataGridTemplateColumn Header="Temperature 2">
                                <DataGridTemplateColumn.CellStyle>
                                    <Style TargetType="{x:Type DataGridCell}">
                                        <Setter Property="IsTabStop" Value="False" />
                                        <Setter Property="Focusable" Value="False" />
                                    </Style>
                                </DataGridTemplateColumn.CellStyle>
                                <DataGridTemplateColumn.CellTemplate>
                                    <DataTemplate>
                                        <TextBox x:Name="txtTemp2" IsEnabled="{Binding ContactVM.IsLocked, Converter={StaticResource BooleanInverter}, FallbackValue=True}" Text="{Binding Temp2, Mode=TwoWay, StringFormat=N1}" LostFocus="txtPrevTemp2_LostFocus" />
                                    </DataTemplate>
                                </DataGridTemplateColumn.CellTemplate>
                            </DataGridTemplateColumn>

                            <DataGridTemplateColumn Header="{x:Static p:Resources.ColHeaderNotes}">
                                <DataGridTemplateColumn.CellStyle>
                                    <Style TargetType="{x:Type DataGridCell}">
                                        <Setter Property="IsTabStop" Value="False" />
                                        <Setter Property="Focusable" Value="False" />
                                    </Style>
                                </DataGridTemplateColumn.CellStyle>
                                <DataGridTemplateColumn.CellTemplate>
                                    <DataTemplate>
                                        <TextBox x:Name="txtFollowUpNotes" IsEnabled="{Binding ContactVM.IsLocked, Converter={StaticResource BooleanInverter}, FallbackValue=True}"  Text="{Binding Notes, Mode=TwoWay}" LostFocus="txtPrevFollowUpNotes_LostFocus" />
                                    </DataTemplate>
                                </DataGridTemplateColumn.CellTemplate>
                            </DataGridTemplateColumn>
                        </DataGrid.Columns>
                    </DataGrid>
                </StackPanel>
            </StackPanel>

            <StackPanel Grid.Row="1" x:Name="panelDailyContacts" Visibility="Collapsed" Margin="10,5,10,10">
                <StackPanel>
                    <Border Background="{StaticResource DataGridHeaderBackgroundBrush}" x:Name="borderDailyContacts">
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto" MinWidth="250" />
                                <ColumnDefinition Width="*" />
                                <ColumnDefinition Width="Auto" />
                            </Grid.ColumnDefinitions>
                            <!--<TextBlock Margin="5" FontWeight="SemiBold" FontSize="16" Foreground="White">Today's Follow-ups</TextBlock>-->

                            <StackPanel Orientation="Horizontal" VerticalAlignment="Bottom" Grid.Column="0">
                                <TextBlock Margin="5, 5, 15, 5" FontWeight="SemiBold" FontSize="16" Foreground="{StaticResource DataGridHeaderForegroundBrush}" Text="{x:Static p:Resources.TodaysFollowUps}" />

                                <TextBlock Margin="5, 5, 0, 5" FontWeight="SemiBold" FontSize="16" Foreground="{StaticResource DataGridHeaderForegroundBrush}">(</TextBlock>
                                <TextBlock Margin="0, 5, 0, 5" FontWeight="SemiBold" FontSize="16" Foreground="{StaticResource DataGridHeaderForegroundBrush}" Text="{Binding Path=DailyFollowUpCollection.Count}"></TextBlock>
                                <TextBlock Margin="0, 5, 5, 5" FontWeight="SemiBold" FontSize="16" Foreground="{StaticResource DataGridHeaderForegroundBrush}">)</TextBlock>
                            </StackPanel>

                            <StackPanel HorizontalAlignment="Left" Grid.Column="1" Margin="2, 0, 2, 4">
                                <!--<Border BorderThickness="2" BorderBrush="{StaticResource WindowBorderBrush}" Background="White">
                                    <StackPanel>
                                        <Label Padding="1" Margin="2" FontSize="8pt">Check ✓ if seen and healthy</Label>
                                        <Label Padding="1" Margin="2" FontSize="8pt">Check ✗ if seen and sick. If sick, write symptoms under Notes.</Label>
                                        <Label Padding="1" Margin="2" FontSize="8pt">Check – if not seen.</Label>
                                        <Label Padding="1" Margin="2" FontSize="8pt">Check NR if no information was recorded.</Label>
                                    </StackPanel>
                                </Border>-->
                                <wpf:ContactTracingLegend />
                            </StackPanel>

                            <StackPanel Margin="2" Orientation="Horizontal" VerticalAlignment="Bottom" Grid.Column="2">

                                <wpf:DarkOnLightCircleButton x:Name="btnPrintDailyReport" Margin="1"
                                                         Click="btnPrintDailyFollowUp_Click"
                                                         Text="{x:Static p:Resources.PrintDailyReport}"
                                                         Tag="panelDailyContacts"
                                                         PathData="F1 M 25,27L 25,17L 51,17L 51,27L 47,27L 47,21L 29,21L 29,27L 25,27 Z M 16,28L 60,28L 60,51L 52,51L 52,46L 55,46L 55,33L 21,33L 21,46L 24,46L 24,51L 16,51L 16,28 Z M 25,39L 28,39L 28,52L 35,52L 35,59L 48,59L 48,39L 51,39L 51,62L 33,62L 25,54L 25,39 Z M 46,55L 38,55L 38,52L 46,52L 46,55 Z M 46,49L 30,49L 30,46L 46,46L 46,49 Z M 46,43L 30,43L 30,40L 46,40L 46,43 Z "
                                                         >
                                    <!--<wpf:DarkOnLightCircleButton.ContextMenu>
                                        <ContextMenu>
                                            <MenuItem Header="{Binding Adm1}" Click="btnPrintDailyFollowUpByDistrict_Click"></MenuItem>
                                            <MenuItem Header="{Binding Adm2}" Click="btnPrintDailyFollowUpBySC_Click"></MenuItem>
                                            <MenuItem Header="{Binding Adm4}" Click="btnPrintDailyFollowUpByVillage_Click"></MenuItem>
                                        </ContextMenu>
                                    </wpf:DarkOnLightCircleButton.ContextMenu>-->
                                </wpf:DarkOnLightCircleButton>

                                <wpf:DarkOnLightCircleButton x:Name="btnPrint21DayReport" Margin="1"
                                                         Click="btnPrint21DayFollowUp_Click"
                                                         Text="{x:Static p:Resources.Print21DayReport}"
                                                         PathData="F1 M 25,27L 25,17L 51,17L 51,27L 47,27L 47,21L 29,21L 29,27L 25,27 Z M 16,28L 60,28L 60,51L 52,51L 52,46L 55,46L 55,33L 21,33L 21,46L 24,46L 24,51L 16,51L 16,28 Z M 25,39L 28,39L 28,52L 35,52L 35,59L 48,59L 48,39L 51,39L 51,62L 33,62L 25,54L 25,39 Z M 46,55L 38,55L 38,52L 46,52L 46,55 Z M 46,49L 30,49L 30,46L 46,46L 46,49 Z M 46,43L 30,43L 30,40L 46,40L 46,43 Z "
                                                         />

                                <wpf:DarkOnLightCircleButton x:Name="btnExcelReport" Margin="1"
                                                         Click="btnExcelReport_Click"
                                                         Text="Send to Excel"
                                                         PathData="F1 M 42,24L 57,24L 57,52L 42,52L 42,50L 47,50L 47,46L 42,46L 42,45L 47,45L 47,41L 42,41L 42,40L 47,40L 47,36L 42,36L 42,35L 47,35L 47,31L 42,31L 42,30L 47,30L 47,26L 42,26L 42,24 Z M 54.9995,50.0005L 54.9997,46.0003L 47.9995,46.0003L 47.9995,50.0005L 54.9995,50.0005 Z M 54.9996,41.0004L 47.9995,41.0004L 47.9995,45.0003L 54.9997,45.0003L 54.9996,41.0004 Z M 54.9996,36.0004L 47.9995,36.0004L 47.9995,40.0004L 54.9996,40.0004L 54.9996,36.0004 Z M 54.9996,31.0004L 47.9995,31.0004L 47.9995,35.0004L 54.9996,35.0004L 54.9996,31.0004 Z M 54.9995,26.0005L 47.9995,26.0005L 47.9995,30.0004L 54.9996,30.0004L 54.9995,26.0005 Z M 18.9997,23.7503L 40.9994,19.7506L 40.9994,56.2506L 18.9997,52.2503L 18.9997,23.7503 Z M 34.6404,44.5147L 31.3367,37.4084L 34.5522,30.4699L 31.9399,30.5805L 30.2234,34.6963L 30.0162,35.3903L 29.8872,35.8892L 29.8596,35.8895C 29.4574,34.1248 28.7481,32.4436 28.1318,30.7417L 25.2803,30.8624L 28.2549,37.4637L 24.997,44.0621L 27.7904,44.1932L 29.5296,39.8757L 29.7578,38.9297L 29.7876,38.93C 30.2317,40.8236 31.1236,42.5844 31.861,44.3843L 34.6404,44.5147 Z "
                                                         />

                            </StackPanel>
                        </Grid>
                    </Border>

                    <DataGrid x:Name="dgDaily" MaxHeight="600" VerticalAlignment="Stretch"
                      ItemsSource="{Binding Path=DailyFollowUpCollection, IsAsync=True, FallbackValue=...}"                          
                  VirtualizingStackPanel.IsVirtualizing="True"
                  VirtualizingStackPanel.VirtualizationMode="Standard"
                      Style="{StaticResource DataGridDemoStyle}"
                              CanUserReorderColumns="False"
                              ScrollViewer.PanningMode="Both"
                              MouseDoubleClick="dgDaily_MouseDoubleClick">
                        <DataGrid.Columns>

                            <DataGridTemplateColumn Header="">
                                <DataGridTemplateColumn.CellTemplate>
                                    <DataTemplate>
                                        <Path Width="12" 
                                          Height="12" 
                                          Stretch="Fill" 
                                          Visibility="{Binding ContactVM.IsLocked, Converter={StaticResource BooleanToVisibilityConverter}, FallbackValue=Collapsed}"
                                        Data="F1 M 22.17,36.4216L 25.3369,36.4216L 25.3369,31.6711C 25.3369,24.6745 31.0087,19.0027 38.0053,19.0027C 45.0019,19.0027 50.6737,24.6745 50.6737,31.6711L 50.6737,36.4216L 53.841,36.4216L 53.8411,57.008L 22.17,57.008L 22.17,36.4216 Z M 45.9231,31.6711C 45.9231,27.2982 42.3782,23.7533 38.0053,23.7533C 33.6324,23.7533 30.0875,27.2982 30.0875,31.6711L 30.0875,36.4216L 45.923,36.4216L 45.9231,31.6711 Z">
                                            <Path.Style>
                                                <Style TargetType="{x:Type Path}">
                                                    <Setter Property="Fill" Value="{StaticResource HighlightBrush}" />
                                                    <Style.Triggers>
                                                        <DataTrigger
                        Binding="{Binding
                            RelativeSource={RelativeSource
                                Mode=FindAncestor,
                                AncestorType={x:Type DataGridCell}},
                                Path=IsSelected}"
                        Value="True">
                                                            <Setter Property="Fill" Value="White"/>
                                                        </DataTrigger>
                                                    </Style.Triggers>
                                                </Style>
                                            </Path.Style>
                                        </Path>
                                    </DataTemplate>
                                </DataGridTemplateColumn.CellTemplate>
                            </DataGridTemplateColumn>

                            <DataGridTextColumn Header="{x:Static p:Resources.ColHeaderContactID}" Binding="{Binding ContactID}" IsReadOnly="True" Visibility="{Binding Data.ShowColumn, 
                            Converter={StaticResource BooleanToVisibilityConverter}, Source={StaticResource proxy}}" />
                            <DataGridTextColumn  Binding="{Binding ContactVM.ContactCDCID}" IsReadOnly="True"  Visibility="{Binding Data.IsCountryUS, 
                            Converter={StaticResource BooleanToVisibilityConverter}, Source={StaticResource proxy}}" Header="{x:Static p:Resources.ColHeaderID}" />
                            <DataGridTextColumn  Binding="{Binding ContactVM.ContactStateID}" IsReadOnly="True"  Visibility="{Binding Data.IsCountryUS, 
                            Converter={StaticResource BooleanToVisibilityConverter}, Source={StaticResource proxy}}" Header="{x:Static p:Resources.ColHeaderOriginalID}"/>
                            <DataGridTextColumn Header="{x:Static p:Resources.ColHeaderSurname}" Binding="{Binding ContactVM.Surname}" IsReadOnly="True"></DataGridTextColumn>
                            <DataGridTextColumn Header="{x:Static p:Resources.ColHeaderOtherNames}" Binding="{Binding ContactVM.OtherNames}" IsReadOnly="True"></DataGridTextColumn>
                            <DataGridTextColumn Header="{x:Static p:Resources.ColHeaderAge}" Binding="{Binding ContactVM.AgeYears}" IsReadOnly="True"></DataGridTextColumn>
                            <DataGridTextColumn Header="{x:Static p:Resources.ColHeaderGender}" Binding="{Binding ContactVM.Gender}" IsReadOnly="True"></DataGridTextColumn>
                            
                            <DataGridTextColumn Header="{x:Static p:Resources.Adm4Default}" Binding="{Binding ContactVM.Village}" IsReadOnly="True">
                                <DataGridTextColumn.HeaderTemplate>
                                    <DataTemplate>
                                        <TextBlock TextAlignment="Center" Text="{Binding RelativeSource={RelativeSource
                                Mode=FindAncestor,
                                AncestorType={x:Type Window}},
                                Path=DataContext.Adm4}" />
                                    </DataTemplate>
                                </DataGridTextColumn.HeaderTemplate>
                            </DataGridTextColumn>

                            <DataGridTextColumn Header="{x:Static p:Resources.Adm3Default}" Binding="{Binding ContactVM.Parish}" IsReadOnly="True"  Visibility="{Binding Data.ShowColumn, 
                            Converter={StaticResource BooleanToVisibilityConverter}, Source={StaticResource proxy}}">
                                <DataGridTextColumn.HeaderTemplate>
                                    <DataTemplate>
                                        <TextBlock TextAlignment="Center" Text="{Binding RelativeSource={RelativeSource
                                Mode=FindAncestor,
                                AncestorType={x:Type Window}},
                                Path=DataContext.Adm3}" />
                                    </DataTemplate>
                                </DataGridTextColumn.HeaderTemplate>
                            </DataGridTextColumn>
                            
                            <DataGridTextColumn Header="{x:Static p:Resources.Adm2Default}" Binding="{Binding ContactVM.SubCounty}" IsReadOnly="True">
                                <DataGridTextColumn.HeaderTemplate>
                                    <DataTemplate>
                                        <TextBlock TextAlignment="Center" Text="{Binding RelativeSource={RelativeSource
                                Mode=FindAncestor,
                                AncestorType={x:Type Window}},
                                Path=DataContext.Adm2}" />
                                    </DataTemplate>
                                </DataGridTextColumn.HeaderTemplate>
                            </DataGridTextColumn>
                            <DataGridTextColumn Header="{x:Static p:Resources.Adm1Default}" Binding="{Binding ContactVM.District}" IsReadOnly="True">
                                <DataGridTextColumn.HeaderTemplate>
                                    <DataTemplate>
                                        <TextBlock TextAlignment="Center" Text="{Binding RelativeSource={RelativeSource
                                Mode=FindAncestor,
                                AncestorType={x:Type Window}},
                                Path=DataContext.Adm1}" />
                                    </DataTemplate>
                                </DataGridTextColumn.HeaderTemplate>
                            </DataGridTextColumn>

                            <DataGridTextColumn Header="{x:Static p:Resources.ColHeaderDay}" Binding="{Binding Day}" IsReadOnly="True"></DataGridTextColumn>
                            <!--Binding="{Binding DateLastContact, StringFormat='dd/MM/yyyy'}"-->
                            <DataGridTextColumn  IsReadOnly="True" SortMemberPath="DateLastContact">
                                <DataGridTextColumn.HeaderTemplate>
                                    <DataTemplate>
                                        <TextBlock Text="{x:Static p:Resources.ColHeaderDateLastContact}" />
                                    </DataTemplate>
                                </DataGridTextColumn.HeaderTemplate>
                                <DataGridTextColumn.Binding>
                                    <MultiBinding Converter="{StaticResource DateConverter}" >
                                        <Binding Path="DataContext.DateLastContact" RelativeSource="{RelativeSource Self}"/>
                                        <Binding Path="DataContext.ApplicationCulture" RelativeSource="{RelativeSource  AncestorType={x:Type Window}}"/>
                                    </MultiBinding>
                                </DataGridTextColumn.Binding>
                            </DataGridTextColumn> 
                            <!--Binding="{Binding MonitorTo, StringFormat='dd/MM/yyyy'}"-->
                            <DataGridTextColumn IsReadOnly="True" SortMemberPath="MonitorTo">
                                <DataGridTextColumn.HeaderTemplate>
                                    <DataTemplate>
                                        <TextBlock Text="{x:Static p:Resources.ColHeaderDateLastFollowUp}" />
                                    </DataTemplate>
                                </DataGridTextColumn.HeaderTemplate>
                                <DataGridTextColumn.Binding>
                                    <MultiBinding Converter="{StaticResource DateConverter}" >
                                        <Binding Path="DataContext.MonitorTo" RelativeSource="{RelativeSource Self}"/>
                                        <Binding Path="DataContext.ApplicationCulture" RelativeSource="{RelativeSource  AncestorType={x:Type Window}}"/>
                                    </MultiBinding>
                                </DataGridTextColumn.Binding>
                            </DataGridTextColumn>
                            <DataGridTextColumn Header="{x:Static p:Resources.ColHeaderTeam}" Binding="{Binding ContactVM.Team}" IsReadOnly="True"></DataGridTextColumn>
                            <DataGridTextColumn Binding="{Binding ContactVM.LastSourceCase.ID}" IsReadOnly="True">
                                <DataGridTextColumn.HeaderTemplate>
                                    <DataTemplate>
                                        <TextBlock Text="{x:Static p:Resources.ColHeaderSourceCaseID}" />
                                    </DataTemplate>
                                </DataGridTextColumn.HeaderTemplate>
                            </DataGridTextColumn>
                            <DataGridTextColumn Binding="{Binding ContactVM.LastSourceCase.Surname}" IsReadOnly="True">
                                <DataGridTextColumn.HeaderTemplate>
                                    <DataTemplate>
                                        <TextBlock Text="{x:Static p:Resources.ColHeaderSourceCaseSurname}" />
                                    </DataTemplate>
                                </DataGridTextColumn.HeaderTemplate>
                            </DataGridTextColumn>
                            <DataGridTextColumn Binding="{Binding ContactVM.LastSourceCase.OtherNames}" IsReadOnly="True">
                                <DataGridTextColumn.HeaderTemplate>
                                    <DataTemplate>
                                        <TextBlock Text="{x:Static p:Resources.ColHeaderSourceCaseOtherNames}" />
                                    </DataTemplate>
                                </DataGridTextColumn.HeaderTemplate>
                            </DataGridTextColumn>

                            <DataGridTemplateColumn Header="{x:Static p:Resources.ColHeaderStatus}">
                                <DataGridTemplateColumn.CellTemplate>
                                    <DataTemplate>
                                        <Controls:StatusSelector IsEnabled="{Binding ContactVM.IsLocked, Converter={StaticResource BooleanInverter}, FallbackValue=True}" DataContext="{Binding}" StatusChanged="statusControl_StatusChanged" />
                                    </DataTemplate>
                                </DataGridTemplateColumn.CellTemplate>
                            </DataGridTemplateColumn>

                            <DataGridTemplateColumn Header="Temperature 1" >
                                <DataGridTemplateColumn.CellStyle>
                                    <Style TargetType="{x:Type DataGridCell}">
                                        <Setter Property="IsTabStop" Value="False" />
                                        <Setter Property="Focusable" Value="False" />
                                    </Style>
                                </DataGridTemplateColumn.CellStyle>
                                <DataGridTemplateColumn.CellTemplate>
                                    <DataTemplate>
                                        <TextBox x:Name="txtTemp1" IsEnabled="{Binding ContactVM.IsLocked, Converter={StaticResource BooleanInverter}, FallbackValue=True}" Text="{Binding Temp1, Mode=TwoWay, StringFormat=N1}" LostFocus="txtTemp1_LostFocus"  />
                                    </DataTemplate>
                                </DataGridTemplateColumn.CellTemplate>
                            </DataGridTemplateColumn>

                            <DataGridTemplateColumn Header="Temperature 2">
                                <DataGridTemplateColumn.CellStyle>
                                    <Style TargetType="{x:Type DataGridCell}">
                                        <Setter Property="IsTabStop" Value="False" />
                                        <Setter Property="Focusable" Value="False" />
                                    </Style>
                                </DataGridTemplateColumn.CellStyle>
                                <DataGridTemplateColumn.CellTemplate>
                                    <DataTemplate>
                                        <TextBox x:Name="txtTemp2" IsEnabled="{Binding ContactVM.IsLocked, Converter={StaticResource BooleanInverter}, FallbackValue=True}" Text="{Binding Temp2, Mode=TwoWay, StringFormat=N1}" LostFocus="txtTemp2_LostFocus"   />
                                    </DataTemplate>
                                </DataGridTemplateColumn.CellTemplate>
                            </DataGridTemplateColumn>

                            <DataGridTemplateColumn Header="{x:Static p:Resources.ColHeaderNotes}">
                                <DataGridTemplateColumn.CellStyle>
                                    <Style TargetType="{x:Type DataGridCell}">
                                        <Setter Property="IsTabStop" Value="False" />
                                        <Setter Property="Focusable" Value="False" />
                                    </Style>
                                </DataGridTemplateColumn.CellStyle>
                                <DataGridTemplateColumn.CellTemplate>
                                    <DataTemplate>
                                        <TextBox x:Name="txtFollowUpNotes" IsEnabled="{Binding ContactVM.IsLocked, Converter={StaticResource BooleanInverter}, FallbackValue=True}" Text="{Binding Notes, Mode=TwoWay}" LostFocus="txtFollowUpNotes_LostFocus"  />
                                    </DataTemplate>
                                </DataGridTemplateColumn.CellTemplate>
                            </DataGridTemplateColumn>

                            <!--<DataGridTextColumn Header="Notes" Binding="{Binding Notes, Mode=TwoWay}"  />-->

                        </DataGrid.Columns>
                    </DataGrid>
                </StackPanel>
            </StackPanel>

            <StackPanel x:Name="panelAllContacts" Visibility="Visible" Grid.Row="1" Margin="10,5,10,10">
                <Border Background="{StaticResource DataGridHeaderBackgroundBrush}">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition/>
                            <ColumnDefinition Width="Auto"/>
                        </Grid.ColumnDefinitions>

                        <StackPanel Orientation="Horizontal" Grid.Column="0">
                            <TextBlock Margin="5, 5, 15, 5" FontWeight="SemiBold" FontSize="16" Foreground="{StaticResource DataGridHeaderForegroundBrush}" Text="{x:Static p:Resources.AllContacts}" />

                            <TextBlock Margin="5, 5, 0, 5" FontWeight="SemiBold" FontSize="16" Foreground="{StaticResource DataGridHeaderForegroundBrush}">(</TextBlock>
                            <TextBlock Margin="0, 5, 0, 5" FontWeight="SemiBold" FontSize="16" Foreground="{StaticResource DataGridHeaderForegroundBrush}" Text="{Binding Path=ContactCollectionView.Count}"></TextBlock>
                            <TextBlock Margin="0, 5, 5, 5" FontWeight="SemiBold" FontSize="16" Foreground="{StaticResource DataGridHeaderForegroundBrush}">)</TextBlock>
                        </StackPanel>


                        <StackPanel Orientation="Horizontal" Margin="2" Grid.Column="1">

                            <wpf:DarkOnLightCircleButton x:Name="btnExportContacts" Margin="1"
                                                         Click="btnExportAllContacts_Click"
                                                         Text="{x:Static p:Resources.Export}"
                                                         PathData="F1 M 35,43L 35,25.5L 27,35L 27,25.25L 38,12.75L 49,25.25L 49,35L 41,25.5L 41,43L 35,43 Z M 17,38L 33,38L 33,42L 21,42L 21,53L 55,53L 55,42L 43,42L 43,38L 59,38L 59,57L 17,57L 17,38 Z M 33,46L 43,46L 43,49L 33,49L 33,46 Z "
                                                         >
                                <wpf:DarkOnLightCircleButton.ContextMenu>
                                    <ContextMenu>
                                        <MenuItem Header="{x:Static p:Resources.ExportForAnalysis}" Click="btnExportContactsAnalysis_Click"></MenuItem>
                                        <!--<MenuItem Header="Create data package" Click="btnExportContactsDataPackage_Click"></MenuItem>-->
                                    </ContextMenu>
                                </wpf:DarkOnLightCircleButton.ContextMenu>
                            </wpf:DarkOnLightCircleButton>

                        </StackPanel>
                    </Grid>
                </Border>
                <DataGrid x:Name="dgAllContacts"
                      ItemsSource="{Binding ContactCollectionView, Mode=Default, IsAsync=True, FallbackValue=...}"
                  VirtualizingStackPanel.IsVirtualizing="True"
                  VirtualizingStackPanel.VirtualizationMode="Recycling"
                          ScrollViewer.PanningMode="Both"
                  Style="{StaticResource DataGridDemoStyle}"
                          AutoGenerateColumns="False"
                          CanUserReorderColumns="False"
                          SelectionChanged="dgAllContacts_SelectionChanged" MouseDoubleClick="dgAllContacts_MouseDoubleClick">
                    <DataGrid.Columns>
                        <DataGridTemplateColumn Header="Actions">
                            <DataGridTemplateColumn.CellTemplate>
                                <DataTemplate>
                                    <Controls:ContactActionsRowControl DataContext="{Binding}" 
                                                                    ShowConvertButton="True"
                                                                    ShowDeleteButton="True"
                                                                    ShowPrintButton="False"
                                                                    DeleteRequested="contact_arc_DeleteRequested"
                                                                    
                                                                       ConversionToCaseIsoRequested="contact_arc_ConversionToCaseIsoRequested"
                                                                    ConversionToCasePrevSickRequested="contact_arc_ConversionToCasePrevSickRequested"
                                                                       ConversionToCaseDiedRequested="contact_arc_ConversionToCaseDiedRequested"
                                                                     />
                                </DataTemplate>
                            </DataGridTemplateColumn.CellTemplate>
                        </DataGridTemplateColumn>

                        <DataGridTemplateColumn Header="">
                            <DataGridTemplateColumn.CellTemplate>
                                <DataTemplate>
                                    <StackPanel Background="Transparent" MouseLeftButtonDown="ForceUnlockContactRequested">
                                        <Path Width="12" 
                                          Height="12" 
                                          Stretch="Fill" 
                                          Visibility="{Binding IsLocked, Converter={StaticResource BooleanToVisibilityConverter}, FallbackValue=Collapsed}"
                                        Data="F1 M 22.17,36.4216L 25.3369,36.4216L 25.3369,31.6711C 25.3369,24.6745 31.0087,19.0027 38.0053,19.0027C 45.0019,19.0027 50.6737,24.6745 50.6737,31.6711L 50.6737,36.4216L 53.841,36.4216L 53.8411,57.008L 22.17,57.008L 22.17,36.4216 Z M 45.9231,31.6711C 45.9231,27.2982 42.3782,23.7533 38.0053,23.7533C 33.6324,23.7533 30.0875,27.2982 30.0875,31.6711L 30.0875,36.4216L 45.923,36.4216L 45.9231,31.6711 Z">
                                            <Path.Style>
                                                <Style TargetType="{x:Type Path}">
                                                    <Setter Property="Fill" Value="{StaticResource HighlightBrush}" />
                                                    <Style.Triggers>
                                                        <DataTrigger
                        Binding="{Binding
                            RelativeSource={RelativeSource
                                Mode=FindAncestor,
                                AncestorType={x:Type DataGridCell}},
                                Path=IsSelected}"
                        Value="True">
                                                            <Setter Property="Fill" Value="White"/>
                                                        </DataTrigger>
                                                    </Style.Triggers>
                                                </Style>
                                            </Path.Style>
                                        </Path>
                                    </StackPanel>
                                </DataTemplate>
                            </DataGridTemplateColumn.CellTemplate>
                        </DataGridTemplateColumn>

                        <DataGridTextColumn Header="" Binding="{Binding IsCaseSymbol}" IsReadOnly="True" />
                        <DataGridTextColumn Binding="{Binding ContactID}" IsReadOnly="True" Visibility="{Binding Data.ShowColumn, 
                            Converter={StaticResource BooleanToVisibilityConverter}, Source={StaticResource proxy}}">
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderContactID}" />
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn>
                        <DataGridTextColumn  Binding="{Binding ContactCDCID}" IsReadOnly="True" Visibility="{Binding Data.IsCountryUS, 
                            Converter={StaticResource BooleanToVisibilityConverter}, Source={StaticResource proxy}}">
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderID}" />
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn>
                        <DataGridTextColumn Binding="{Binding ContactStateID}" IsReadOnly="True" Visibility="{Binding Data.IsCountryUS, 
                            Converter={StaticResource BooleanToVisibilityConverter}, Source={StaticResource proxy}}">
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderOriginalID}" />
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn>
                        <DataGridTextColumn Binding="{Binding Surname}" IsReadOnly="True" >
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderSurname}" />
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn>
                        <DataGridTextColumn Binding="{Binding OtherNames}" IsReadOnly="True" >
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderOtherNames}" />
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn>
                        <DataGridTextColumn Binding="{Binding Gender}" IsReadOnly="True" >
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderGender}" />
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn>
                        <DataGridTextColumn Binding="{Binding AgeYears}" IsReadOnly="True" >
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderAge}" />
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn> 
                        <!--Binding="{Binding DateOfLastContact, StringFormat='dd/MM/yyyy'}"-->
                        <DataGridTextColumn IsReadOnly="True" SortMemberPath="DateOfLastContact">
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderDateLastContact}" />
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                            <DataGridTextColumn.Binding>
                                <MultiBinding Converter="{StaticResource DateConverter}" >
                                    <Binding Path="DataContext.DateOfLastContact" RelativeSource="{RelativeSource Self}"/>
                                    <Binding Path="DataContext.ApplicationCulture" RelativeSource="{RelativeSource  AncestorType={x:Type Window}}"/>
                                </MultiBinding>
                            </DataGridTextColumn.Binding>
                        </DataGridTextColumn> 
                        <!--Binding="{Binding DateOfLastFollowUp, StringFormat='dd/MM/yyyy'}"-->
                        <DataGridTextColumn IsReadOnly="True" SortMemberPath="DateOfLastFollowUp">
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderDateLastFollowUp}" />
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                            <DataGridTextColumn.Binding>
                                <MultiBinding Converter="{StaticResource DateConverter}" >
                                    <Binding Path="DataContext.DateOfLastFollowUp" RelativeSource="{RelativeSource Self}"/>
                                    <Binding Path="DataContext.ApplicationCulture" RelativeSource="{RelativeSource  AncestorType={x:Type Window}}"/>
                                </MultiBinding>
                            </DataGridTextColumn.Binding>
                        </DataGridTextColumn>
                        <DataGridTextColumn Binding="{Binding Team}" IsReadOnly="True"  Visibility="{Binding Data.ShowColumn, 
                            Converter={StaticResource BooleanToVisibilityConverter}, Source={StaticResource proxy}}">
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderContactTracingTeam}" />
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn>
                        <DataGridTextColumn Binding="{Binding RiskLevel}" IsReadOnly="True">
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderRiskLevel}" />
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn>
                        <DataGridTextColumn Binding="{Binding HeadOfHousehold}" IsReadOnly="True" Visibility="{Binding Data.ShowColumn, 
                            Converter={StaticResource BooleanToVisibilityConverter}, Source={StaticResource proxy}}">
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock Text="{x:Static p:Resources.ColHeaderHeadHousehold}" />
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn>
                        <DataGridTextColumn Binding="{Binding Village}" IsReadOnly="True">
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{Binding RelativeSource={RelativeSource
                                Mode=FindAncestor,
                                AncestorType={x:Type Window}},
                                Path=DataContext.Adm4}" />
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn>
                        <DataGridTextColumn Binding="{Binding Parish}" IsReadOnly="True" Visibility="{Binding Data.ShowColumn, 
                            Converter={StaticResource BooleanToVisibilityConverter}, Source={StaticResource proxy}}">
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{Binding RelativeSource={RelativeSource
                                Mode=FindAncestor,
                                AncestorType={x:Type Window}},
                                Path=DataContext.Adm3}" />
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn>
                        <DataGridTextColumn Binding="{Binding SubCounty}" IsReadOnly="True">
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <!--<TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderSubCounty}" />-->
                                    <TextBlock TextAlignment="Center" Text="{Binding RelativeSource={RelativeSource
                                Mode=FindAncestor,
                                AncestorType={x:Type Window}},
                                Path=DataContext.Adm2}" />
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn>
                        <DataGridTextColumn Binding="{Binding District}" IsReadOnly="True">
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <!--<TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderDistrict}" />-->
                                    <TextBlock TextAlignment="Center" Text="{Binding RelativeSource={RelativeSource
                                Mode=FindAncestor,
                                AncestorType={x:Type Window}},
                                Path=DataContext.Adm1}" />
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn>
                        <DataGridTextColumn Binding="{Binding LC1Chairman}" IsReadOnly="True" Visibility="{Binding Data.ShowColumn, 
                            Converter={StaticResource BooleanToVisibilityConverter}, Source={StaticResource proxy}}">
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderLC1Chairman}" />
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn>
                        <DataGridTextColumn Binding="{Binding Phone}" IsReadOnly="True">
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderPhone}" />
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn>
                        <DataGridTextColumn Binding="{Binding HCW}" IsReadOnly="True">
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderHCW}" />
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn>
                        <DataGridTextColumn Binding="{Binding HCWFacility}" IsReadOnly="True">
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderHealthCareFacility}" />
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn>
                        <DataGridTextColumn Binding="{Binding Team}" IsReadOnly="True" Visibility="{Binding Data.IsCountryUS, 
                            Converter={StaticResource BooleanToVisibilityConverter}, Source={StaticResource proxy}}">
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderTeam}" />
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn>
                        <DataGridTextColumn Binding="{Binding PublicHealthAction}" IsReadOnly="True" Visibility="{Binding Data.IsCountryUS, 
                            Converter={StaticResource BooleanToVisibilityConverter}, Source={StaticResource proxy}}">
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderPublicHealthAction}" />
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn>
                        <DataGridTextColumn Binding="{Binding FinalOutcome, Converter={StaticResource FinalOutcomeConverter}}" IsReadOnly="True">
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderFinalOutcome}" />
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn>
                        <!--<DataGridTextColumn Binding="{Binding DateLastContact, StringFormat='dd/MM/yyyy'}" IsReadOnly="True">
                            <DataGridTextColumn.Header>
                                <TextBlock>
                                    Date of
                                <LineBreak />
                                    last contact
                                </TextBlock>
                            </DataGridTextColumn.Header>
                        </DataGridTextColumn>-->
                    </DataGrid.Columns>
                </DataGrid>

                <DockPanel Height="10" />

                <Border x:Name="borderExposuresForContact" Background="{StaticResource DataGridHeaderBackgroundBrush}">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition/>
                            <ColumnDefinition Width="Auto"/>
                        </Grid.ColumnDefinitions>

                        <StackPanel Orientation="Horizontal" Grid.Column="0">
                            <TextBlock Margin="5, 5, 15, 5" FontWeight="SemiBold" FontSize="16" Foreground="{StaticResource DataGridHeaderForegroundBrush}" Text="{x:Static p:Resources.SourceCases}" />

                            <TextBlock Margin="5, 5, 0, 5" FontWeight="SemiBold" FontSize="16" Foreground="{StaticResource DataGridHeaderForegroundBrush}">(</TextBlock>
                            <TextBlock Margin="0, 5, 0, 5" FontWeight="SemiBold" FontSize="16" Foreground="{StaticResource DataGridHeaderForegroundBrush}" Text="{Binding Path=CurrentCaseLinkCollection.Count}"></TextBlock>
                            <TextBlock Margin="0, 5, 5, 5" FontWeight="SemiBold" FontSize="16" Foreground="{StaticResource DataGridHeaderForegroundBrush}">)</TextBlock>
                        </StackPanel>

                        <StackPanel Orientation="Horizontal" Grid.Column="1">
                            <!--<Button x:Name="btnExportExposuresForContact" Margin="1" Width="90" Height="20" Style="{StaticResource FlatButtonStyle}" Click="btnExportExposuresForContact_Click">
                                <TextBlock>Export</TextBlock>
                            </Button>-->
                            <!--<Button x:Name="btnEditCaseContactLink" Margin="1" Width="90" Height="18" Style="{StaticResource FlatButtonStyle}" Click="btnEditCaseContactLink_Click">
                                <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Text="{x:Static p:Resources.EditLink}" />
                            </Button>-->
                        </StackPanel>
                    </Grid>
                </Border>
                <DataGrid x:Name="dgExposuresForContact"
                      ItemsSource="{Binding Path=CurrentCaseLinkCollection, IsAsync=True, FallbackValue=...}" 
                  VirtualizingStackPanel.IsVirtualizing="True"
                  VirtualizingStackPanel.VirtualizationMode="Recycling"
                  Style="{StaticResource DataGridDemoStyle}"
                          ScrollViewer.PanningMode="Both"
                          AutoGenerateColumns="False"
                          ColumnHeaderHeight="37"
                          CanUserReorderColumns="False"
                          AreRowDetailsFrozen="True"
                          MouseDoubleClick="dgExposuresForContact_MouseDoubleClick"
                          >
                    <DataGrid.Columns>
                        <DataGridTemplateColumn Header="Actions">
                            <DataGridTemplateColumn.CellTemplate>
                                <DataTemplate>
                                    <Controls:ContactLinkActionsRowControl x:Name="caseLinkActions" DataContext="{Binding}" 
                                                                        ShowUnlinkOption="False"
                                                                           EditLinkRequested="clarc_EditLinkRequested"

                                                                     />
                                </DataTemplate>
                            </DataGridTemplateColumn.CellTemplate>
                        </DataGridTemplateColumn>
                        <DataGridTextColumn Binding="{Binding CaseVM.ID}" IsReadOnly="True">
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderID}" />
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn>
                        <DataGridTextColumn Binding="{Binding CaseVM.OriginalID}" IsReadOnly="True" Visibility="{Binding Data.IsCountryUS, 
                            Converter={StaticResource BooleanToVisibilityConverter}, Source={StaticResource proxy}}">
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderOriginalID}" />
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn>
                        <DataGridTextColumn Binding="{Binding CaseVM.Surname}" IsReadOnly="True">
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderSurname}" />
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn>
                        <DataGridTextColumn Binding="{Binding CaseVM.OtherNames}" IsReadOnly="True">
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderOtherNames}" />
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn>
                        <DataGridTextColumn Binding="{Binding CaseVM.EpiCaseDef, ValidatesOnNotifyDataErrors=False, Converter={StaticResource EpiCaseClassificationConverter}}" IsReadOnly="True">
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderEpiCaseDef}" />
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn>
                        <!--<DataGridTextColumn Header="{x:Static p:Resources.ColHeaderRecStatus}" Binding="{Binding CaseRecordStatus}" IsReadOnly="True"></DataGridTextColumn>-->
                        <DataGridTextColumn Binding="{Binding CaseVM.Gender, ValidatesOnDataErrors=False, Converter={StaticResource GenderConverter}}" IsReadOnly="True" >
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderGender}" />
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn>
                        <DataGridTextColumn Header="{x:Static p:Resources.ColHeaderAge}" Binding="{Binding CaseVM.AgeYears}" IsReadOnly="True" >
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderAge}" />
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn> 
                        <!--Binding="{Binding CaseVM.DateOnset, StringFormat='dd/MM/yyyy'}"-->
                        <DataGridTextColumn IsReadOnly="True" SortMemberPath="CaseVM.DateOnset">
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderOnsetDate}" />
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                            <DataGridTextColumn.Binding>
                                <MultiBinding Converter="{StaticResource DateConverter}" >
                                    <Binding Path="DataContext.CaseVM.DateOnset" RelativeSource="{RelativeSource Self}"/>
                                    <Binding Path="DataContext.ApplicationCulture" RelativeSource="{RelativeSource  AncestorType={x:Type Window}}"/>
                                </MultiBinding>
                            </DataGridTextColumn.Binding>
                        </DataGridTextColumn>

                        <DataGridTextColumn Binding="{Binding CaseVM.CurrentStatus}" IsReadOnly="True">
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderCurrentStatus}" />
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn> 
                        <!--Binding="{Binding CaseVM.DateDeath, StringFormat='dd/MM/yyyy'}"-->
                        <DataGridTextColumn IsReadOnly="True" SortMemberPath="CaseVM.DateDeath">
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderDeathDate}" />
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                            <DataGridTextColumn.Binding>
                                <MultiBinding Converter="{StaticResource DateConverter}" >
                                    <Binding Path="DataContext.CaseVM.DateDeath" RelativeSource="{RelativeSource Self}"/>
                                    <Binding Path="DataContext.ApplicationCulture" RelativeSource="{RelativeSource  AncestorType={x:Type Window}}"/>
                                </MultiBinding>
                            </DataGridTextColumn.Binding>
                        </DataGridTextColumn>
                        <DataGridTextColumn Binding="{Binding CaseVM.IsHCW, Converter={StaticResource HCWConverter}}" IsReadOnly="True" >
                            <!--17179-->
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderIsHCW}" />
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn>

                        <DataGridTextColumn Binding="{Binding CaseVM.Village}" IsReadOnly="True" >
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{Binding RelativeSource={RelativeSource
                                Mode=FindAncestor,
                                AncestorType={x:Type Window}},
                                Path=DataContext.Adm4}" />
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn>

                        <DataGridTextColumn Binding="{Binding CaseVM.Parish}" IsReadOnly="True"  Visibility="{Binding Data.ShowColumn, 
                            Converter={StaticResource BooleanToVisibilityConverter}, Source={StaticResource proxy}}">
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{Binding RelativeSource={RelativeSource
                                Mode=FindAncestor,
                                AncestorType={x:Type Window}},
                                Path=DataContext.Adm3}" />
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn>

                        <DataGridTextColumn Binding="{Binding CaseVM.SubCounty}" IsReadOnly="True">
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <!--<TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderSubCounty}" />-->
                                    <TextBlock TextAlignment="Center" Text="{Binding RelativeSource={RelativeSource
                                Mode=FindAncestor,
                                AncestorType={x:Type Window}},
                                Path=DataContext.Adm2}" />
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn>
                        <DataGridTextColumn Binding="{Binding CaseVM.District}" IsReadOnly="True" >
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <!--<TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderDistrict}" />-->
                                    <TextBlock TextAlignment="Center" Text="{Binding RelativeSource={RelativeSource
                                Mode=FindAncestor,
                                AncestorType={x:Type Window}},
                                Path=DataContext.Adm1}" />
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn>
                        <DataGridTextColumn Binding="{Binding CaseVM.Country}" IsReadOnly="True">
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderCountry}" />
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn>
                        <DataGridTextColumn Binding="{Binding CaseVM.DistrictOnset}" IsReadOnly="True">
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <!--<TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderDistrictOnset}" />-->
                                    <TextBlock TextAlignment="Center" Text="{Binding RelativeSource={RelativeSource
                                Mode=FindAncestor,
                                AncestorType={x:Type Window}},
                                Path=DataContext.Adm1Onset}" />
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn>
                        <DataGridTextColumn Binding="{Binding CaseVM.CountryOnset}" IsReadOnly="True">
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderCountryOnset}" />
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn>
                        <DataGridTextColumn Binding="{Binding CaseVM.Citizenship}" IsReadOnly="True" Visibility="{Binding Data.IsCountryUS, 
                            Converter={StaticResource BooleanToVisibilityConverter}, Source={StaticResource proxy}}">
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderCitizenship}" />
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn>
                        <!--Binding="{Binding CaseVM.DateIsolationCurrent, StringFormat='dd/MM/yyyy'}"-->
                        <DataGridTextColumn  IsReadOnly="True" SortMemberPath="CaseVM.DateIsolationCurrent">
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderIsoAdmitted}" />
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                            <DataGridTextColumn.Binding>
                                <MultiBinding Converter="{StaticResource DateConverter}" >
                                    <Binding Path="DataContext.CaseVM.DateIsolationCurrent" RelativeSource="{RelativeSource Self}"/>
                                    <Binding Path="DataContext.ApplicationCulture" RelativeSource="{RelativeSource  AncestorType={x:Type Window}}"/>
                                </MultiBinding>
                            </DataGridTextColumn.Binding>
                        </DataGridTextColumn>
                        <!--Binding="{Binding CaseVM.DateDischargeIso, StringFormat='dd/MM/yyyy'}"-->
                        <DataGridTextColumn  IsReadOnly="True" SortMemberPath="CaseVM.DateDischargeIso">
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderIsoDischarge}" />
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                            <DataGridTextColumn.Binding>
                                <MultiBinding Converter="{StaticResource DateConverter}" >
                                    <Binding Path="DataContext.CaseVM.DateDischargeIso" RelativeSource="{RelativeSource Self}"/>
                                    <Binding Path="DataContext.ApplicationCulture" RelativeSource="{RelativeSource  AncestorType={x:Type Window}}"/>
                                </MultiBinding>
                            </DataGridTextColumn.Binding>
                        </DataGridTextColumn>
                        <!--<DataGridTextColumn Header="{x:Static p:Resources.ColHeaderDeathDate}" Binding="{Binding CaseDateDeath, StringFormat='dd/MM/yyyy'}" IsReadOnly="True"></DataGridTextColumn>
                        <DataGridTextColumn Binding="{Binding CaseCurrentStatus}" IsReadOnly="True">
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderCurrentStatus}" />
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn>-->
                        <DataGridTextColumn Binding="{Binding CaseVM.FinalLabClass, Converter={StaticResource FinalLabClassificationConverter}}" IsReadOnly="True">
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderFinalLabClass}" />
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn>
                        <!--<DataGridTextColumn Header="Isolation current?" Binding="{Binding CaseIsolationCurrent}" IsReadOnly="True"></DataGridTextColumn>--> 
                        <!--Binding="{Binding DateLastContact, StringFormat='dd/MM/yyyy'}"-->
                        <DataGridTextColumn IsReadOnly="True" SortMemberPath="DateLastContact">
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderDateLastContact}" />
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                            <DataGridTextColumn.Binding>
                                <MultiBinding Converter="{StaticResource DateConverter}" >
                                    <Binding Path="DataContext.DateLastContact" RelativeSource="{RelativeSource Self}"/>
                                    <Binding Path="DataContext.ApplicationCulture" RelativeSource="{RelativeSource  AncestorType={x:Type Window}}"/>
                                </MultiBinding>
                            </DataGridTextColumn.Binding>
                        </DataGridTextColumn>
                        <DataGridTextColumn Binding="{Binding ContactTypeString}" IsReadOnly="True">
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderContactType}" />
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn>
                        <DataGridTextColumn Binding="{Binding Relationship}" IsReadOnly="True">
                            <DataGridTextColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock TextAlignment="Center" Text="{x:Static p:Resources.ColHeaderRelationship}" />
                                </DataTemplate>
                            </DataGridTextColumn.HeaderTemplate>
                        </DataGridTextColumn>
                    </DataGrid.Columns>
                </DataGrid>

                <DockPanel Height="10" />

                <Border x:Name="borderChartHeading" Background="{StaticResource DataGridHeaderBackgroundBrush}" Visibility="Collapsed">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition/>
                            <ColumnDefinition Width="Auto"/>
                        </Grid.ColumnDefinitions>
                        <TextBlock x:Name="txtChartHeading" Margin="5" FontWeight="SemiBold" FontSize="16" Foreground="{StaticResource DataGridHeaderForegroundBrush}"></TextBlock>
                        <StackPanel Margin="2" Orientation="Horizontal" Grid.Column="1">

                            <wpf:DarkOnLightCircleButton x:Name="btnPrint21Day" Margin="1"
                                                         Click="btnPrint21Day_Click"
                                                         Text="{x:Static p:Resources.Print}"
                                                         PathData="F1 M 25,27L 25,17L 51,17L 51,27L 47,27L 47,21L 29,21L 29,27L 25,27 Z M 16,28L 60,28L 60,51L 52,51L 52,46L 55,46L 55,33L 21,33L 21,46L 24,46L 24,51L 16,51L 16,28 Z M 25,39L 28,39L 28,52L 35,52L 35,59L 48,59L 48,39L 51,39L 51,62L 33,62L 25,54L 25,39 Z M 46,55L 38,55L 38,52L 46,52L 46,55 Z M 46,49L 30,49L 30,46L 46,46L 46,49 Z M 46,43L 30,43L 30,40L 46,40L 46,43 Z "
                                                         />
                        </StackPanel>
                    </Grid>
                </Border>

                <StackPanel x:Name="panelChart" Margin="0, 10, 0, 0">
                    <AnalysisControls:SingleContactChart DataContext="{Binding ContactCollectionView.CurrentItem}" IsCountryUS="{Binding Data.IsCountryUS, Source={StaticResource proxy}}" />
                </StackPanel>
            </StackPanel>
        </Grid>

        <Tabs:HospitalizationTab x:Name="gridHospitalizations" Visibility="{Binding IsChecked, ElementName=tabButtonHospitalizations, Converter={StaticResource BooleanToVisibilityConverter}}" Grid.Row="3" />

        <Tabs:AnalysisTab x:Name="gridAnalysis" Visibility="{Binding IsChecked, ElementName=tabButtonAnalysis, Converter={StaticResource BooleanToVisibilityConverter}}" VerticalAlignment="Stretch" Grid.Row="3" />

        <Grid x:Name="gridTransmission" Visibility="{Binding IsChecked, ElementName=tabButtonTransmissionChain, Converter={StaticResource BooleanToVisibilityConverter}}" VerticalAlignment="Stretch" Background="{StaticResource mainPanelBackgroundBrush}" Grid.Row="3">

            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>

            <StackPanel Grid.Row="0" Margin="10,5,0,5" Orientation="Horizontal">
                <TextBlock Grid.Row="0" Style="{StaticResource Heading1}" Text="{x:Static p:Resources.TabTransmissionChain}" />
                <Image Width="20" Height="20" Margin="20,0,0,0" Source="Images\save.png" Cursor="Hand" MouseDown="transmission_saveClick"/>
                <Image Width="20" Height="20" Margin="20,0,0,0" Source="Images\print.png" Cursor="Hand" MouseDown="transmission_printClick"/>
            </StackPanel>
            <StackPanel Grid.Column="0" Grid.Row="1" Margin="10,5,10,10">
                <Border Background="{StaticResource DataGridHeaderBackgroundBrush}">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition/>
                            <ColumnDefinition Width="Auto"/>
                        </Grid.ColumnDefinitions>
                        <Canvas x:Name="TransmissionDates" Background="#9A1D20" Height="30"/>
                    </Grid>
                </Border>
                <ScrollViewer x:Name="transmissionScroller" HorizontalScrollBarVisibility="Visible">
                    <Canvas x:Name="TransmissionCanvas" Background="Transparent" Width="2500"/>
                </ScrollViewer>
            </StackPanel>
        </Grid>

        <Controls:ExistingContact x:Name="existingContact" Visibility="Collapsed" Grid.RowSpan="10" Click="existingContact_Click" />

        <Controls:ExistingCase x:Name="existingCase" Visibility="Collapsed" Grid.RowSpan="10" Click="existingCase_Click" />

        <Controls:ConvertToContact x:Name="convertToContact" Visibility="Collapsed" Grid.RowSpan="10" Click="convertToContact_Click" />

        <Controls:ImportFromLab x:Name="importFromLab" Visibility="Collapsed" Grid.RowSpan="10" Closed="importFromLab_Closed" />

        <StackPanel Grid.Column="100" Grid.Row="100" HorizontalAlignment="Right" VerticalAlignment="Bottom" Orientation="Horizontal">
            <Label Margin="0, 0, 6, 3" Foreground="{StaticResource MediumTextBrush}" Content="EPI INFO VHF APPLICATION [BETA]" />
            <Label x:Name="lblVersion" HorizontalAlignment="Right" VerticalAlignment="Bottom" Grid.Column="10" Grid.Row="100" Foreground="{StaticResource MediumTextBrush}" Margin="6, 0, 6, 3" />
        </StackPanel>

        <Grid x:Name="grdIntro" Grid.Row="0" Grid.RowSpan="100" Grid.Column="0" Grid.ColumnSpan="100" Background="{StaticResource WindowBackgroundBrush}" Visibility="Visible">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="380"/>
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="*" />
            </Grid.RowDefinitions>

            <StackPanel Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="100" Background="{StaticResource NoiseBrush}">
                <StackPanel>
                    <StackPanel.Background>
                        <SolidColorBrush Color="{StaticResource EditionThemeAccentColor}" Opacity="0.8" />
                    </StackPanel.Background>
                    <TextBlock HorizontalAlignment="Left" Margin="30, 10, 20, 20" Style="{StaticResource Heading1}" FontWeight="Light" Foreground="White" Text="{Binding Source={x:Static p:Settings.Default}, Path=Heading, Mode=OneWay}" />
                </StackPanel>
            </StackPanel>

            <StackPanel Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="100" Height="4" HorizontalAlignment="Stretch" VerticalAlignment="Top">
                <StackPanel.Background>
                    <LinearGradientBrush StartPoint="0,0" EndPoint="0,1" >
                        <LinearGradientBrush.GradientStops>
                            <GradientStop Color="#FF9D9D9D" Offset="0" />
                            <GradientStop Color="#009D9D9D" Offset="1.0" />
                            <!--<GradientStop Color="#00F7F7F9" Offset="1.0" />-->
                        </LinearGradientBrush.GradientStops>
                    </LinearGradientBrush>
                </StackPanel.Background>
            </StackPanel>

            <Grid Grid.Column="0" Grid.Row="2" Margin="0, 10, 0, 0">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="*" />
                </Grid.RowDefinitions>
                <StackPanel Grid.Row="0">
                    <Label HorizontalAlignment="Left" Margin="30, 0, 20, 0" Style="{StaticResource LabelHeading2}" Content="{x:Static p:Resources.Welcome}" />
                </StackPanel>
                <Grid Grid.Row="1" Margin="30, 0, 60, 20" Background="{StaticResource HatchBrush}">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="*"/>
                        <RowDefinition Height="40"/>
                    </Grid.RowDefinitions>
                    <Rectangle Fill="{StaticResource DarkTextBrush}" Height="5" VerticalAlignment="Top"></Rectangle>
                    <!--<content:RecentDataSources Margin="0, 8, 0, 0" />-->
                    <StackPanel Margin="10">
                        <TextBlock VerticalAlignment="Top" TextWrapping="Wrap" FontSize="14" Text="{x:Static p:Resources.Instructions1}" />
                        <StackPanel Height="10" />
                        <TextBlock VerticalAlignment="Top" TextWrapping="Wrap" FontSize="14" Text="{x:Static p:Resources.Instructions2}" />
                        <StackPanel Height="10" />
                        <StackPanel Height="1" Background="{StaticResource DarkTextBrush}" />
                        <StackPanel Height="10" />
                        <StackPanel Height="Auto" Orientation="Horizontal" >
                            <StackPanel  Orientation="Vertical">
                                <TextBlock Text="Region" HorizontalAlignment="Left" Margin="0,0,0,0" FontWeight="Bold" />
                                <RadioButton x:Name="radioRegion1" ToolTip="United States" GroupName="Group1" 
                                	Checked="radioRegion1_Checked" Style="{DynamicResource FlatToggleButtonStyle1}" 
                                    Width="40" Height="40" HorizontalAlignment="Left" Margin="0,0,0,0">
                                    <Image Source="/Images/USA.png" VerticalAlignment="Center" HorizontalAlignment="Center" Height="28" Width="30"/>
                                </RadioButton>
                                <RadioButton x:Name="radioRegion2"  GroupName="Group1" ToolTip="International"
                            		Checked="radioRegion2_Checked" Style="{DynamicResource FlatToggleButtonStyle1}" 
                                    Width="40" Height="40" HorizontalAlignment="Left"  Margin="45,-40,0,0">
                                    <Image Source="/Images/World.png" VerticalAlignment="Center" HorizontalAlignment="Center" Height="28" Width="30"/>
                                </RadioButton>
                            </StackPanel>
                            <StackPanel Margin="18,0,0,0" Orientation="Vertical">
                                <TextBlock VerticalAlignment="Top"  x:Name="txtSelectLanguage"  TextWrapping="Wrap" Text="Language" Width="150" HorizontalAlignment="Left" FontWeight="Bold" />
                                <ComboBox  x:Name="cmboCulture"    SelectionChanged="cmboCulture_SelectionChanged" Width="150"  HorizontalAlignment="Left" Margin="0,1,0,0" />
                            </StackPanel>

                        </StackPanel>

                        <Grid  x:Name="newOutbreakGrid"         Margin="0,10,0,0" HorizontalAlignment="Left" Background="Transparent" MouseDown="Grid_MouseDown">
                            <Grid.Style>
                                <Style TargetType="{x:Type Grid}">
                                    <Style.Triggers>
                                        <Trigger Property="IsMouseOver" Value="True">
                                            <Setter Property="Background">
                                                <Setter.Value>
                                                    <SolidColorBrush Opacity="0.5" Color="Silver" />
                                                </Setter.Value>
                                            </Setter>
                                        </Trigger>
                                    </Style.Triggers>
                                </Style>
                            </Grid.Style>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="46" />
                                <ColumnDefinition Width="*" />
                            </Grid.ColumnDefinitions>
                            <Path x:Name="pathPlusNewOutbreak" Grid.Column="0" Width="22" Height="22" Stretch="Fill" Fill="{StaticResource AccentBrush}" Data="F1 M 35,19L 41,19L 41,35L 57,35L 57,41L 41,41L 41,57L 35,57L 35,41L 19,41L 19,35L 35,35L 35,19 Z "/>
                            <Path x:Name="pathCircleNewOutbreak" Grid.Column="0" Width="38" Height="38" Stretch="Fill" Fill="{StaticResource AccentBrush}" Data="F1 M 38,0.791664C 58.5496,0.791664 75.2083,17.4504 75.2083,38C 75.2083,58.5496 58.5496,75.2083 38,75.2083C 17.4504,75.2083 0.791662,58.5496 0.791662,38C 0.791662,17.4504 17.4504,0.791664 38,0.791664 Z M 38,5.54166C 20.0738,5.54166 5.54167,20.0738 5.54167,38C 5.54167,55.9262 20.0738,70.4583 38,70.4583C 55.9262,70.4583 70.4583,55.9262 70.4583,38C 70.4583,20.0738 55.9262,5.54166 38,5.54166 Z "/>
                            <TextBlock x:Name="textBlockNewOutbreak" Grid.Column="1" VerticalAlignment="Center" FontSize="16" FontWeight="Bold" Margin="10, 0, 0, 2" Text="{x:Static p:Resources.NewOutbreak}" />
                        </Grid>

                        <!--<Path Fill="#9A1D20" Data="" />-->
                    </StackPanel>

                </Grid>
            </Grid>

            <Grid Grid.Column="1" Grid.Row="2"  Margin="0, 10, 0, 0">
                <wpf:FileScreen x:Name="fileScreen" ApplicationType="Epi" Grid.RowSpan="10" ProjectOpened="fileScreen_ProjectOpened" />
            </Grid>
        </Grid>

        <!--<DockPanel Grid.RowSpan="100" Background="#66000000" Visibility="{Binding IsEditingAdminBoundaryFieldTypes, Converter={StaticResource BooleanToVisibilityConverter}, FallbackValue=Collapsed}" >
            <diag:DistrictFieldTypeEditor x:Name="fieldTypeEditor" Width="650" Height="280" />
        </DockPanel>-->

        <DockPanel Grid.RowSpan="100" Background="#66000000" x:Name="panelLoading" Visibility="{Binding IsLoadingProjectData, Converter={StaticResource BooleanToVisibilityConverter}, FallbackValue=Collapsed}" >
            <DockPanel HorizontalAlignment="Center" VerticalAlignment="Center">
                <Border BorderBrush="{StaticResource AccentBrush}" BorderThickness="1" Background="{StaticResource LightBackgroundBrush}">
                    <StackPanel Margin="40, 20, 40, 20">

                        <StackPanel>
                            <Rectangle HorizontalAlignment="Left" Width="100" Height="6" Fill="{StaticResource AccentBrush}" />
                            <TextBlock FontSize="24" Foreground="#444444" FontWeight="Bold" Text="{x:Static p:Resources.Loading}" />
                        </StackPanel>

                        <StackPanel Height="10" />
                        <ProgressBar Width="400" HorizontalAlignment="Stretch" Height="16" Foreground="#558FFF" Minimum="0" Maximum="1" Value="{Binding TaskbarProgressValue, FallbackValue=0}" />
                        <StackPanel Height="4" />
                        <TextBlock Text="{Binding LoadStatus, FallbackValue=...}" />
                    </StackPanel>
                </Border>
            </DockPanel>
        </DockPanel>

        <DockPanel Grid.RowSpan="100" Background="#66000000" x:Name="panelDbUpgrade" Visibility="{Binding IsShowingDatabaseUpgrade, Converter={StaticResource BooleanToVisibilityConverter}, FallbackValue=Collapsed}" >
            <DockPanel HorizontalAlignment="Center" VerticalAlignment="Center">
                <Border BorderBrush="{StaticResource AccentBrush}" BorderThickness="1" Background="{StaticResource LightBackgroundBrush}">
                    <StackPanel Margin="40, 20, 40, 20">

                        <StackPanel>
                            <Rectangle HorizontalAlignment="Left" Width="100" Height="6" Fill="{StaticResource AccentBrush}" />
                            <TextBlock FontSize="24" Foreground="#444444" FontWeight="Bold" Text="UPGRADING..." />
                        </StackPanel>

                        <StackPanel Height="10" />
                        <ProgressBar Width="400" HorizontalAlignment="Stretch" Height="16" Foreground="#558FFF" Minimum="0" Maximum="1" Value="{Binding TaskbarProgressValue, FallbackValue=0}" />
                        <StackPanel Height="4" />
                        <TextBlock MaxWidth="400" Text="{Binding UpgradeStatus, FallbackValue=...}" TextWrapping="WrapWithOverflow" />
                    </StackPanel>
                </Border>
            </DockPanel>
        </DockPanel>

        <DockPanel Grid.RowSpan="100" Background="#66000000" x:Name="panelDataSync" Visibility="{Binding IsDataSyncing, Converter={StaticResource BooleanToVisibilityConverter}, FallbackValue=Collapsed}" >
            <DockPanel HorizontalAlignment="Center" VerticalAlignment="Center">
                <Border BorderBrush="{StaticResource AccentBrush}" BorderThickness="1" Background="{StaticResource LightBackgroundBrush}">
                    <StackPanel Margin="40, 20, 40, 20">

                        <StackPanel>
                            <Rectangle HorizontalAlignment="Left" Width="100" Height="6" Fill="{StaticResource AccentBrush}" />
                            <TextBlock FontSize="24" Foreground="#444444" FontWeight="Bold" Text="SYNCHRONIZING DATA" />
                        </StackPanel>

                        <StackPanel Height="10" />
                        <ProgressBar Width="500" HorizontalAlignment="Stretch" Height="16" Foreground="#558FFF" Minimum="0" Maximum="1" Value="{Binding TaskbarProgressValue, FallbackValue=0}" />
                        <StackPanel Height="4" />
                        <TextBlock Text="{Binding SyncStatus, FallbackValue=...}" />
                    </StackPanel>
                </Border>
            </DockPanel>
        </DockPanel>

        <DockPanel Grid.RowSpan="100" Background="#66000000" x:Name="panelDataExport" Visibility="{Binding IsShowingDataExporter, Converter={StaticResource BooleanToVisibilityConverter}, FallbackValue=Collapsed}" >
            <Controls:ExportCsvFile />
        </DockPanel>

        <DockPanel Grid.RowSpan="100" Background="#44000000" x:Name="panelWaitingOnClients" Visibility="{Binding IsWaitingOnOtherClients, Converter={StaticResource BooleanToVisibilityConverter}, FallbackValue=Collapsed}" >
            <DockPanel HorizontalAlignment="Center" VerticalAlignment="Center">
                <Border BorderBrush="{StaticResource AccentBrush}" BorderThickness="1" Background="{StaticResource LightBackgroundBrush}">
                    <StackPanel Margin="40, 20, 40, 20">

                        <StackPanel>
                            <Rectangle HorizontalAlignment="Left" Width="100" Height="6" Fill="{StaticResource AccentBrush}" />
                            <TextBlock FontSize="24" Foreground="#444444" FontWeight="Bold" Text="WAITING ON OTHER CLIENTS" />
                        </StackPanel>

                        <StackPanel Height="10" />
                        <ProgressBar Width="400" HorizontalAlignment="Stretch" Height="16" IsIndeterminate="True" Foreground="#558FFF" Minimum="0" Maximum="1" />
                        <StackPanel Height="4" />
                    </StackPanel>
                </Border>
            </DockPanel>
        </DockPanel>

        <DockPanel Grid.RowSpan="100" Background="#44000000" x:Name="panelWaitingOnServer" Visibility="{Binding IsConnected, Converter={StaticResource BooleanToCollapsedConverter}, FallbackValue=Collapsed}" >
            <DockPanel HorizontalAlignment="Center" VerticalAlignment="Center">
                <Border BorderBrush="{StaticResource AccentBrush}" BorderThickness="1" Background="{StaticResource LightBackgroundBrush}">
                    <StackPanel Margin="40, 20, 40, 20">

                        <StackPanel>
                            <Rectangle HorizontalAlignment="Left" Width="100" Height="6" Fill="{StaticResource AccentBrush}" />
                            <TextBlock FontSize="24" Foreground="#444444" FontWeight="Bold" Text="WAITING ON SERVER RESPONSE" />
                        </StackPanel>

                        <StackPanel Height="10" />
                        <ProgressBar Width="500" HorizontalAlignment="Stretch" Height="16" IsIndeterminate="True" Foreground="#558FFF" Minimum="0" Maximum="1" />
                        <StackPanel Height="4" />
                    </StackPanel>
                </Border>
            </DockPanel>
        </DockPanel>

        <wpf:ProjectSettings x:Name="initialSetup" Visibility="Collapsed" Grid.RowSpan="10" Closed="initialSetup_Closed" />

        <wpf:NewOutbreak x:Name="newOutbreak" Visibility="Collapsed" Grid.RowSpan="10" Closed="newOutbreak_Closed" />

        <DockPanel Grid.RowSpan="100" Background="#44000000" Visibility="{Binding ExportSyncFileViewModel.IsDisplaying, Converter={StaticResource BooleanToVisibilityConverter}, FallbackValue=Collapsed}" >
            <Controls:ExportSyncFile Width="750" Height="450" DataContext="{Binding ExportSyncFileViewModel}" />
        </DockPanel>

        <DockPanel Grid.RowSpan="100" Background="#44000000" Visibility="{Binding SqlToMdbCopierViewModel.IsDisplaying, Converter={StaticResource BooleanToVisibilityConverter}, FallbackValue=Collapsed}" >
            <Controls:SqlToMdbCopier Width="700" Height="350" DataContext="{Binding SqlToMdbCopierViewModel}" />
        </DockPanel>

        <DockPanel x:Name="dpShortForm" Grid.RowSpan="100" Background="#44000000" IsVisibleChanged="dpShortForm_IsVisibleChanged"
                   Visibility="{Binding CaseOpenedInShortForm.IsEditing, Converter={StaticResource BooleanToVisibilityConverter}, FallbackValue=Collapsed}" >
<!--Changed Visibility from CaseCollectionView.CurrentItem to CaseOpenedInShortForm VHF-260-->
            <Grid HorizontalAlignment="Center" VerticalAlignment="Center" >
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="*" />
                </Grid.RowDefinitions>

                <!--<Border BorderBrush="{StaticResource AccentBrush}" BorderThickness="1, 1, 1, 0" Background="{StaticResource LightBackgroundBrush}"
            Padding="20, 2, 20, 0">
                    <StackPanel Grid.Row="0" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Top" Height="Auto" Margin="0" Visibility="{Binding CaseCollectionView.CurrentItem.IsNewRecord, Converter={StaticResource BooleanToCollapsedConverter}, FallbackValue=Collapsed}">
                    <Button x:Name="btnFirst" Margin="8, 0, 8, 0" Command="{Binding Path=MoveToFirstCaseRecordCommand}" Style="{StaticResource NavButtonStyle}" IsEnabled="{Binding Path=MoveToFirstCaseRecordCommand.CanExecute}">
                        <Button.Content>
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto" />
                                    <ColumnDefinition Width="1" />
                                    <ColumnDefinition Width="Auto" />
                                </Grid.ColumnDefinitions>

                                <Path Grid.Column="2" HorizontalAlignment="Center" Width="12" Height="12" Stretch="Fill" Fill="{Binding ElementName=btnFirst, Path=Foreground}" Data="F1 M 30.0833,22.1667L 50.6665,37.6043L 50.6665,38.7918L 30.0833,53.8333L 30.0833,22.1667 Z">
                                    <Path.RenderTransform>
                                        <RotateTransform CenterX="6" CenterY="6" Angle="180" />
                                    </Path.RenderTransform>
                                </Path>
                                <Rectangle Grid.Column="0" Height="12" Width="2" Fill="{Binding ElementName=btnFirst, Path=Foreground}"></Rectangle>

                            </Grid>
                        </Button.Content>
                    </Button>

                    <Button x:Name="btnPrev" Margin="8, 0, 8, 0" Command="{Binding Path=MoveToPreviousCaseRecordCommand}" Style="{StaticResource NavButtonStyle}" IsEnabled="{Binding Path=MoveToPreviousCaseRecordCommand.CanExecute}">
                        <Button.Content>
                            <Grid>
                                <Path HorizontalAlignment="Center" Width="12" Height="12" Stretch="Fill" Fill="{Binding ElementName=btnPrev, Path=Foreground}" Data="F1 M 30.0833,22.1667L 50.6665,37.6043L 50.6665,38.7918L 30.0833,53.8333L 30.0833,22.1667 Z">
                                    <Path.RenderTransform>
                                        <RotateTransform CenterX="6" CenterY="6" Angle="180" />
                                    </Path.RenderTransform>
                                </Path>
                            </Grid>
                        </Button.Content>
                    </Button>

                    <TextBox x:Name="tbox1" Margin="16, 0, 0, 0" MinWidth="38" VerticalAlignment="Center" Text="{Binding CaseCollectionView.CurrentPosition, Mode=OneWay, NotifyOnSourceUpdated=True, Converter={StaticResource PlusOneConverter}}"></TextBox>
                    <TextBlock Margin="6" VerticalAlignment="Center" Text="of" Foreground="{StaticResource DarkTextBrush}" />
                    <TextBlock Margin="0, 0, 16, 0" VerticalAlignment="Center" DataContext="{Binding CaseCollectionView}" Foreground="{StaticResource DarkTextBrush}" Text="{Binding Path=Count, Mode=OneWay, NotifyOnSourceUpdated=True}" />

                    <Button x:Name="btnNext" Margin="8, 0, 8, 0" Command="{Binding Path=MoveToNextCaseRecordCommand}" Style="{StaticResource NavButtonStyle}">
                        <Button.Content>
                            <Grid>
                                <Path HorizontalAlignment="Center" Width="12" Height="12" Stretch="Fill" Fill="{Binding ElementName=btnNext, Path=Foreground}" Data="F1 M 30.0833,22.1667L 50.6665,37.6043L 50.6665,38.7918L 30.0833,53.8333L 30.0833,22.1667 Z"/>
                            </Grid>
                        </Button.Content>
                    </Button>

                    <Button x:Name="btnLast" Margin="8, 0, 8, 0" Command="{Binding Path=MoveToLastCaseRecordCommand}" Style="{StaticResource NavButtonStyle}">
                        <Button.Content>
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto" />
                                    <ColumnDefinition Width="1" />
                                    <ColumnDefinition Width="Auto" />
                                </Grid.ColumnDefinitions>

                                <Path HorizontalAlignment="Center" Width="12" Height="12" Stretch="Fill" Fill="{Binding ElementName=btnLast, Path=Foreground}" Data="F1 M 30.0833,22.1667L 50.6665,37.6043L 50.6665,38.7918L 30.0833,53.8333L 30.0833,22.1667 Z" />
                                <Rectangle Grid.Column="2" Height="12" Width="2" Fill="{Binding ElementName=btnLast, Path=Foreground}"></Rectangle>
                            </Grid>
                        </Button.Content>
                    </Button>

                </StackPanel>
                </Border>-->
		<!--Changed dataContext binding from CaseCollectionView.CurrentItem to CaseOpenedInShortForm VHF-260-->
                <Controls:ShortCaseEntryForm Grid.Row="1" x:Name="shortCaseform"  DataContext="{Binding CaseOpenedInShortForm, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, NotifyOnValidationError=True}" Width="900" 
                                            />
            </Grid>
        </DockPanel>

        <DockPanel Grid.RowSpan="100" Background="#44000000" Visibility="{Binding IsShowingError, Converter={StaticResource BooleanToVisibilityConverter}, FallbackValue=Collapsed}" >
            <DockPanel HorizontalAlignment="Center" VerticalAlignment="Center">
                <wpf:ErrorPanel x:Name="errorPanel" Width="500" />
            </DockPanel>
        </DockPanel>
        <!--<Controls:ContactEntryForm Width="Auto" Height="Auto" Background="White" />-->

    </Grid>
</Window>
